.project-summary-strip,
.project-finance-band,
.item-quantity-band {
    display: grid;
    margin-bottom: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.project-summary-strip {
    grid-template-columns: 1fr 1fr 2fr;
}

.project-summary-strip > div,
.project-finance-band > div,
.item-quantity-band > div {
    min-width: 0;
    padding: 16px 18px;
    border-right: 1px solid var(--line);
}

.project-summary-strip > div:last-child,
.project-finance-band > div:last-child,
.item-quantity-band > div:last-child {
    border-right: 0;
}

.project-summary-strip span,
.project-finance-band span,
.item-quantity-band span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 730;
    text-transform: uppercase;
}

.project-summary-strip strong,
.project-finance-band strong,
.item-quantity-band strong {
    display: block;
    color: var(--ink);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    font-weight: 740;
    overflow-wrap: anywhere;
}

.project-summary-strip small,
.project-finance-band small,
.item-quantity-band small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
}

.project-filter {
    grid-template-columns: minmax(260px, 1fr) 180px auto auto;
}

.project-table {
    min-width: 1060px;
}

.project-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.project-hero > div:first-child {
    min-width: 0;
    flex: 1;
}

.project-finance-band {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-quantity-band {
    grid-template-columns: 1fr 1fr 2fr;
}

.item-purpose {
    font-size: 15px !important;
}

.section-danger-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* The address uses the complete width beneath the four primary fields. */
.project-site-address {
    grid-column: 1 / -1;
}

/* Site addresses are expected to contain Persian text. */
.project-site-address dd {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

/* Keep timestamps separate from the project's main business information. */
.project-record-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.project-record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
    margin: 0;
}

.project-record-meta div {
    display: grid;
    gap: 4px;
}

.project-record-meta dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.project-record-meta dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* The footer already provides its own separator and spacing. */
.project-record-footer .section-danger-action {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border-top: 0;
}

@media (max-width: 700px) {
    .project-record-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .project-record-footer .section-danger-action {
        justify-content: flex-end;
    }
}

.project-form {
    padding: 28px 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/*
Project names, client details, locations, addresses, and notes are
expected to contain Persian text.
*/
.project-form input.xtx-data-rtl,
.project-form textarea.xtx-data-rtl {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: plaintext;
}

.finance-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 24px 0 18px;
    padding: 13px 15px;
    background: #f4f8f6;
    border: 1px solid #cbded8;
    border-radius: 5px;
}

.finance-preview span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.finance-preview strong {
    color: #075e54;
    font-variant-numeric: tabular-nums;
}

.item-table {
    min-width: 880px;
}

.activity-timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-timeline > li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    padding: 0 0 22px;
}

.activity-timeline > li:last-child {
    padding-bottom: 0;
}

.activity-marker {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid #b9ddd6;
    border-radius: 50%;
}

.activity-marker svg {
    width: 15px;
    height: 15px;
}

.activity-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.activity-heading time,
.activity-timeline p {
    color: var(--muted);
    font-size: 11px;
}

.activity-timeline p {
    margin: 3px 0 0;
}

.activity-timeline details {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}

.activity-timeline summary {
    cursor: pointer;
    font-weight: 650;
}

.activity-timeline details dl {
    display: grid;
    gap: 4px;
    margin: 8px 0 0;
}

.activity-timeline details dl > div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
}

.activity-timeline dt {
    font-weight: 700;
}

.activity-timeline dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.status-badge[data-status="approved"],
.status-badge[data-status="completed"] {
    color: #17603a;
    background: #e7f5ec;
    border-color: #b8dec7;
}

.status-badge[data-status="on_hold"] {
    color: #7a5200;
    background: #fff5d8;
    border-color: #e8d08b;
}

.status-badge[data-status="cancelled"] {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #efbdb7;
}

.login-shell {
    max-width: 460px;
    margin: 7vh auto 0;
}

.login-heading {
    margin-bottom: 18px;
    text-align: center;
}

.login-heading > span {
    display: grid;
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    place-items: center;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid #b9ddd6;
    border-radius: 7px;
}

.login-heading svg {
    width: 20px;
}

.expense-quick-form {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        minmax(150px, 220px)
        170px
        auto;
    align-items: start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/*
Client-paid amount sits directly below Cost.

Row 1:
Name | Cost | Date | Add expense

Row 2:
     | Client-paid amount
*/

/*
Cost and Client-paid amount occupy exactly the same horizontal
position because they are children of one vertical wrapper.
*/
.expense-cost-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-self: start;
    min-width: 0;
}

/* Expense name entry typography. Keep this after shared input rules. */
.expense-quick-form .expense-name-field > input[name="name"] {
    box-sizing: border-box;
    height: 44px;
    min-height: 44px;
    padding: 0 13px;

    font-family: var(--font-persian) !important;
    font-size: 19px !important;
    font-weight: 200 !important;
    line-height: 1.2 !important;
}

.expense-quick-form
.expense-name-field
> input[name="name"]::placeholder {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 400;
    opacity: 1;
}

.expense-cost-fields .form-field {
    width: 100%;
    margin: 0;
}

.expense-cost-fields input {
    width: 100%;
}

/*
The button has no label above it, so this offset aligns it with
the Cost and Date inputs on the first row.
*/
.expense-quick-form > .button[type="submit"] {
    align-self: start;
    margin-top: 25px;
}

.expense-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 20px;
}

.form-actions--with-setting {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 20px;

    /*
    This controls physical UI placement only:
    setting on left, commands on right.
    */
    direction: ltr;
}

.form-actions__commands {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.project-setting-action {
    display: flex;
    align-items: center;
}

/* Remove the normal form-field spacing inside the action bar. */
.project-setting-action .form-field {
    margin: 0;
}

/* Keep the toggle compact. */
.project-setting-action .toggle-control {
    min-height: 40px;
}

/* No secondary description underneath the setting name. */
.project-setting-action .toggle-copy small {
    display: none;
}

.expense-quick-form .form-field {
    margin: 0;
}

/* Keep expense inputs aligned when validation errors appear. */
.expense-quick-form .expense-name-field,
.expense-quick-form .expense-cost-fields .form-field,
.expense-quick-form > .form-field {
    grid-template-rows: auto 44px minmax(18px, auto);
}

/* Supplier errors remain inside the expandable supplier row. */
.expense-supplier-fields .form-field {
    grid-template-rows: auto 44px minmax(18px, auto);
}

.expense-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.expense-total span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.expense-total strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.expense-delete {
    color: var(--danger);
}

.expense-delete:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

@media (max-width: 900px) {
    .expense-quick-form {
        grid-template-columns: 1fr 1fr;
    }

    .expense-quick-form .button {
        align-self: end;
    }
}

@media (max-width: 560px) {
    .expense-quick-form {
        grid-template-columns: 1fr;
    }

    .expense-quick-form .button {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .project-summary-strip,
    .project-finance-band,
    .item-quantity-band {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-summary-strip > div:nth-child(2n),
    .project-finance-band > div:nth-child(2n),
    .item-quantity-band > div:nth-child(2n) {
        border-right: 0;
    }

    .project-summary-strip > div:nth-child(n + 3),
    .project-finance-band > div:nth-child(n + 3),
    .item-quantity-band > div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .project-filter {
        grid-template-columns: minmax(220px, 1fr) 160px auto;
    }

    .project-filter .button--ghost {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 720px) {
    .project-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-form {
        padding: 22px 17px;
    }

    }

@media (max-width: 520px) {
    .project-summary-strip,
    .project-finance-band,
    .item-quantity-band,
    .project-filter {
        grid-template-columns: 1fr;
    }

    .project-summary-strip > div,
    .project-finance-band > div,
    .item-quantity-band > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .project-summary-strip > div:last-child,
    .project-finance-band > div:last-child,
    .item-quantity-band > div:last-child {
        border-bottom: 0;
    }

    .project-summary-strip > div:nth-child(n + 3),
    .project-finance-band > div:nth-child(n + 3),
    .item-quantity-band > div:nth-child(n + 3) {
        border-top: 0;
    }

    .finance-preview,
    .activity-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .activity-timeline details dl > div {
        grid-template-columns: 1fr;
        gap: 1px;
    }
}

.jdp-container {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
}

.jdp-container input,
.jdp-container select {
    color: var(--ink);
    background: var(--surface-subtle);
    border-color: var(--line);
}

.jdp-day:not(.disabled):hover {
    background: var(--primary-soft);
}

.jdp-day.selected {
    color: var(--on-primary);
    background: var(--primary);
}

/*
Desktop transport quick-entry layout.

Primary row:
Cargo | Vehicle | Cost | Date | Carrier | Action stack

The action stack contains Add transport with the smaller Transport object
selector directly beneath it.

The route section occupies the complete width below the primary row.
*/
.transport-quick-form {
    width: 100%;
    margin-bottom: 18px;
    padding: 18px;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.transport-main-fields {
    display: grid;
    grid-template-columns:
        minmax(260px, 2fr)
        minmax(145px, 0.9fr)
        minmax(125px, 0.75fr)
        minmax(170px, 0.9fr)
        minmax(170px, 1fr)
        154px;
    gap: 12px;
    align-items: start;
    width: 100%;
}

.transport-main-fields .form-field,
.transport-object-field .form-field,
.transport-route-fields .form-field {
    min-width: 0;
    margin: 0;
}

.transport-main-fields input,
.transport-main-fields select,
.transport-main-fields textarea,
.transport-route-fields input {
    width: 100%;
    min-width: 0;
}

/*
Keep the primary action fixed in the final column. The small object
selector remains beneath it and does not resize the other fields.
*/
.transport-action-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    width: 154px;
    min-width: 154px;
}

.transport-submit-button {
    width: 154px;
    min-width: 154px;
    height: 42px;
    min-height: 42px;
    white-space: nowrap;
}

.transport-object-field {
    width: 154px;
    min-width: 0;
}

.transport-object-field .form-field {
    display: grid;
    gap: 4px;
}

.transport-object-field .form-field > label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.transport-object-field select {
    width: 154px;
    min-width: 0;
    height: 34px;
    min-height: 34px;
    padding-block: 4px;
    font-size: 12px;
}

/*
The complete route area is separate from the primary entry row.
*/
.transport-route-section {
    width: 100%;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/*
Route disclosure control.
*/
.transport-route-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    min-height: 32px;
    padding: 3px 5px;
    color: var(--ink-soft);
    font: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.transport-route-toggle:hover {
    color: var(--ink);
}

.transport-route-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.transport-route-toggle__identity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
}

.transport-route-toggle__identity svg {
    width: 17px;
    height: 17px;
    color: var(--primary);
}

.transport-route-toggle__chevron {
    width: 15px;
    height: 15px;
    transition: transform 160ms ease;
}

.transport-route-toggle[aria-expanded="true"]
.transport-route-toggle__chevron {
    transform: rotate(180deg);
}

/*
Full-width route visualization.
*/
.transport-route-visual {
    display: grid;
    grid-template-columns:
        minmax(120px, max-content)
        minmax(180px, 1fr)
        minmax(120px, max-content)
        auto;
    gap: 18px;
    align-items: center;
    width: 100%;
    min-height: 78px;
    margin-top: 5px;
    padding: 13px 16px;
    background: color-mix(
        in srgb,
        var(--surface-strong) 72%,
        transparent
    );
    border: 1px solid var(--line);
    border-radius: 4px;
}

.transport-route-point {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.transport-route-point--destination {
    justify-content: flex-end;
}

.transport-route-point__icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(
        in srgb,
        var(--primary) 35%,
        var(--line)
    );
    border-radius: 50%;
}

.transport-route-point__icon svg {
    width: 17px;
    height: 17px;
}

.transport-route-point__name {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
The center track expands to occupy all remaining horizontal space.
*/
.transport-route-track {
    position: relative;
    display: flex;
    min-width: 160px;
    height: 34px;
    align-items: center;
}

.transport-route-track__line {
    width: 100%;
    height: 1px;
    background: color-mix(
        in srgb,
        var(--primary) 55%,
        var(--line)
    );
}

.transport-route-track__line::before,
.transport-route-track__line::after {
    position: absolute;
    top: 50%;
    width: 6px;
    height: 6px;
    content: "";
    background: var(--primary);
    border-radius: 50%;
    transform: translateY(-50%);
}

.transport-route-track__line::before {
    left: 0;
}

.transport-route-track__line::after {
    right: 0;
}

.transport-route-track__vehicle {
    position: absolute;
    left: 50%;
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 50%;
    transform: translateX(-50%);
}

.transport-route-track__vehicle svg {
    width: 16px;
    height: 16px;
}

.transport-route-track__arrow {
    position: absolute;
    right: -3px;
    width: 16px;
    height: 16px;
    color: var(--primary);
    background: var(--surface-strong);
}

.transport-route-default {
    display: inline-flex;
    min-height: 20px;
    align-items: center;
    padding: 2px 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 650;
    background: var(--primary-soft);
    border-radius: 3px;
}

.transport-route-default[hidden] {
    display: none;
}

/*
Origin and Destination appear beneath the route visualization without
changing the dimensions of the main entry row.
*/
.transport-route-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 0;
}

.transport-route-fields[hidden] {
    display: none;
}

.transport-quick-form input::placeholder {
    direction: ltr;
    text-align: left;
}

.space-section {
    padding: 0;
    background: transparent;
    border: 0;
}

.space-section__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 2px 18px;
    border-bottom: 1px solid var(--line);
}

.space-section__header h2 {
    margin: 0;
}

/* Reserve an error-message row so validation does not move the inputs. */
/* Make placeholder text consistently visible in both themes. */
.space-empty {
    display: flex;
    min-height: 110px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.space-empty div {
    display: grid;
    gap: 2px;
}

.space-empty strong {
    color: var(--ink-soft);
}

.space-empty span {
    font-size: 12px;
}

@media (max-width: 800px) {
    }

/* Placeholder text follows the LTR English interface design.
   The user's entered text remains RTL because the inputs still use dir="rtl". */
/* --------------------------------------------------------------------------
   Editorial project workspace
   -------------------------------------------------------------------------- */

.project-overview {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 2fr);
    align-items: end;
    gap: 64px;
    margin-bottom: 0;
    padding: 34px 0 40px;
    background: var(--surface-strong);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 0 0 100vmax var(--surface-strong);
    clip-path: inset(0 -100vmax);
}

html[data-theme="dark"] .project-overview {
    background: var(--bg);
    box-shadow: 0 0 0 100vmax var(--bg);
}

.project-hero {
    display: flex;
    min-height: 190px;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    gap: 28px;
    margin: 0;
}

.project-hero .back-link {
    margin-bottom: 28px;
    color: var(--primary);
    font-size: 11px;
}

.project-hero .eyebrow {
    margin-bottom: 8px;
}

.project-hero h1 {
    max-width: 100%;
    margin: 0;
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 500;
    line-height: 0.95;
    overflow-wrap: anywhere;
}

.project-hero .page-summary {
    margin-top: 12px;
}

.project-hero .header-actions {
    gap: 10px;
}

.project-finance-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-self: center;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.project-finance-band > div {
    position: relative;
    min-height: 104px;
    padding: 12px 24px;
    border: 0;
    border-inline-start: 1px solid var(--line-strong);
}

.project-finance-band > div:last-child {
    border-inline-end: 1px solid var(--line-strong);
}

.project-finance-band > div:nth-child(2)::after {
    position: absolute;
    right: 24px;
    bottom: 8px;
    left: 24px;
    height: 2px;
    background: var(--line);
    border-inline-start: 42% solid var(--primary);
    content: "";
}

.project-finance-band span {
    margin-bottom: 12px;
    color: var(--secondary);
    font-size: 9px;
    font-weight: 760;
}

.project-finance-band > div:nth-child(2) span {
    color: var(--primary);
}

.project-finance-band > div:nth-child(3) span {
    color: var(--blue);
}

.project-finance-band > div:nth-child(4) span {
    color: var(--rust);
}

.project-finance-band strong {
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 620;
}

.project-finance-band small {
    font-size: 10px;
}

.detail-nav {
    position: sticky;
    z-index: 15;
    top: var(--topbar-height);
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0;
    overflow-x: visible;
    background: var(--bg);
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}

.detail-nav a {
    position: relative;
    min-height: 58px;
    padding: 20px 0 16px;
    color: var(--muted);
    background: transparent;
    border-radius: 0;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: uppercase;
}

.detail-nav a::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: transparent;
    content: "";
}

.detail-nav a:hover,
.detail-nav a.is-active {
    color: var(--ink);
    background: transparent;
}

.detail-nav a.is-active::after {
    background: var(--primary);
}

.detail-section,
html[data-theme="dark"] .detail-section {
    margin-top: 0;
    padding: 48px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.space-section {
    padding-top: 34px;
}

.space-section__header {
    padding: 0 0 26px;
    border: 0;
}

.space-section__heading-copy {
    display: grid;
    gap: 20px;
}

.space-section__heading-copy .section-kicker {
    margin: 0;
}

.space-section__title-row {
    display: grid;
    grid-template-columns: minmax(170px, max-content) minmax(220px, 320px);
    align-items: end;
    gap: 64px;
}

.space-section__header h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 500;
    line-height: 1;
}

.space-section__intro {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.space-element-workspace {
    display: grid;
    grid-template-columns: minmax(290px, 0.82fr) minmax(620px, 1.86fr);
    align-items: stretch;
    gap: 24px;
}

.space-panel,
.element-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: visible;
}

.space-panel__header,
.element-panel__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 80px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.space-panel__header h3,
.element-panel__header h3 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 21px;
    font-weight: 680;
    line-height: 1.2;
}

.element-panel__header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.workspace-create {
    position: relative;
}

.workspace-create > summary {
    list-style: none;
    cursor: pointer;
}

.workspace-create > summary::-webkit-details-marker {
    display: none;
}

.workspace-create[open] > summary {
    position: relative;
    z-index: 3;
}

.workspace-create__form {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 20;
    display: grid;
    gap: 14px;
    width: min(330px, calc(100vw - 48px));
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    box-shadow:
        0 18px 45px rgb(20 18 15 / 12%),
        0 4px 14px rgb(20 18 15 / 7%);
}

.workspace-create__form--element {
    width: min(430px, calc(100vw - 48px));
}

.element-create-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 12px;
}

.workspace-create__form .field {
    margin: 0;
}

.workspace-create__form .button {
    justify-self: end;
}

.space-panel__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.space-panel__item + .space-panel__item {
    border-top: 1px solid var(--line);
}

.space-panel__link {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 12px 20px;
    color: var(--ink);
    text-decoration: none;
    transition:
        color 140ms ease,
        background-color 140ms ease;
}

.space-panel__link:hover {
    color: var(--ink);
    background: var(--surface-subtle);
}

.space-panel__index {
    display: inline-grid;
    place-items: center;
    width: 30px;
    min-height: 30px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.space-panel__link strong {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-panel__element-count {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.space-panel__link > svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
    stroke-width: 1.7;
    transition: transform 140ms ease;
}

.space-panel__link:hover > svg {
    transform: translateX(2px);
}

.element-table {
    min-width: 0;
}

.element-table__header,
.element-entry__summary {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        62px
        minmax(220px, 1.55fr)
        92px
        50px;
    align-items: center;
    gap: 14px;
}

.element-table__header {
    min-height: 37px;
    padding: 0 20px;
    color: var(--secondary);
    border-bottom: 1px solid var(--line);
    font-size: 9px;
    font-weight: 760;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.element-table__header span:nth-child(2),
.element-table__header span:nth-child(4),
.element-table__header span:nth-child(5) {
    text-align: center;
}

.element-entry {
    border-bottom: 1px solid var(--line);
}

.element-entry:last-child {
    border-bottom: 0;
}

.element-entry__summary {
    min-height: 54px;
    padding: 8px 20px;
    color: var(--ink);
    list-style: none;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.element-entry__summary::-webkit-details-marker {
    display: none;
}

.element-entry__summary:hover {
    background: var(--surface-subtle);
}

.element-entry__name {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.element-entry__name > svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    color: var(--muted);
    stroke-width: 1.8;
    transition: transform 160ms ease;
}

.element-entry[open]
    .element-entry__name > svg {
    transform: rotate(90deg);
}

.element-entry__name strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.element-entry__quantity {
    justify-self: center;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.allocation-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.allocation-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 4px 8px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1;
}

.allocation-chip strong {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    min-height: 18px;
    padding: 0 4px;
    background: var(--surface-subtle);
    border-radius: 4px;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.allocation-empty {
    color: var(--muted);
    font-size: 11px;
}

.unassigned-pill {
    justify-self: center;
    display: inline-grid;
    place-items: center;
    min-width: 31px;
    min-height: 26px;
    padding: 3px 8px;
    color: #9a4f13;
    background: #fffaf2;
    border: 1px solid #c66c21;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
}

.unassigned-zero {
    justify-self: center;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.element-entry__action {
    justify-self: center;
    width: 16px;
    height: 16px;
    color: var(--muted);
    stroke-width: 1.8;
    transition: transform 160ms ease;
}

.element-entry[open]
    .element-entry__action {
    transform: rotate(-90deg);
}

.element-entry__editor {
    display: grid;
    grid-template-columns: 150px minmax(320px, 1fr) minmax(160px, 0.7fr);
    gap: 24px;
    margin: 0 14px 10px;
    padding: 16px;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.element-total {
    padding-right: 20px;
    border-right: 1px solid var(--line);
}

.element-total span,
.allocation-editor__label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
}

.element-total strong {
    color: var(--ink);
    font-size: 25px;
    font-weight: 560;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.allocation-editor {
    min-width: 0;
}

.allocation-editor__row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.allocation-edit-form {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: 18px minmax(130px, 1fr) 82px 30px;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.allocation-drag {
    display: inline-grid;
    place-items: center;
    color: var(--muted);
}

.allocation-drag svg {
    width: 14px;
    height: 14px;
}

.allocation-edit-form select,
.allocation-edit-form input,
.allocation-create-form select,
.allocation-create-form input {
    width: 100%;
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    font: inherit;
    font-size: 12px;
}

.allocation-edit-form input,
.allocation-create-form input {
    font-variant-numeric: tabular-nums;
}

.allocation-save,
.allocation-delete-form button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.allocation-save:hover {
    color: var(--ink);
    background: var(--surface);
}

.allocation-delete-form {
    display: flex;
    margin: 0;
}

.allocation-delete-form button:hover {
    color: var(--danger);
    background: var(--surface);
}

.allocation-save svg,
.allocation-delete-form svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.8;
}

.allocation-readonly {
    min-width: 0;
    color: var(--ink);
    font-size: 12px;
}

.allocation-create-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 82px auto;
    gap: 8px;
    margin: 10px 38px 0 26px;
}

.allocation-create-form .button {
    min-height: 34px;
    height: 34px;
    padding-top: 0;
    padding-bottom: 0;
}

.element-entry__remaining {
    display: flex;
    align-items: center;
    padding-left: 24px;
    border-left: 1px solid var(--line);
    font-size: 12px;
}

.element-entry__remaining strong {
    color: #a75818;
    font-weight: 650;
}

.element-entry__remaining span {
    color: var(--muted);
}

.workspace-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    min-height: 220px;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.workspace-empty--compact {
    min-height: 170px;
}

.workspace-empty > svg {
    width: 27px;
    height: 27px;
    margin-bottom: 5px;
    color: var(--muted);
    stroke-width: 1.5;
}

.workspace-empty strong {
    color: var(--ink);
    font-size: 14px;
}

.workspace-empty span {
    max-width: 290px;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 1180px) {
    .space-element-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .space-panel__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .space-panel__item:nth-child(even) {
        border-left: 1px solid var(--line);
    }

    .space-panel__item:nth-child(2) {
        border-top: 0;
    }
}

@media (max-width: 820px) {
    .space-section__title-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .space-section__intro {
        max-width: 360px;
    }

    .element-table {
        overflow-x: auto;
    }

    .element-table__header,
    .element-entry__summary {
        min-width: 760px;
    }

    .element-entry__editor {
        grid-template-columns: minmax(0, 1fr);
    }

    .element-total,
    .element-entry__remaining {
        padding: 0;
        border: 0;
    }

    .element-entry__remaining {
        min-height: 32px;
    }
}

@media (max-width: 620px) {
    .space-panel__header,
    .element-panel__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-create {
        width: 100%;
    }

    .workspace-create > summary {
        width: 100%;
    }

    .workspace-create__form,
    .workspace-create__form--element {
        right: auto;
        left: 0;
        width: 100%;
    }

    .element-create-fields,
    .space-panel__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .space-panel__item:nth-child(even) {
        border-left: 0;
    }

    .space-panel__item:nth-child(2) {
        border-top: 1px solid var(--line);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .project-overview,
    .detail-nav,
    .detail-section {
        animation: project-surface-enter 360ms ease both;
    }

    .detail-nav {
        animation-delay: 50ms;
    }

    .detail-section {
        animation-delay: 90ms;
    }
}

@keyframes project-surface-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1080px) {
    .project-overview {
        grid-template-columns: minmax(230px, 0.6fr) minmax(0, 1.6fr);
        gap: 36px;
    }

    .project-finance-band > div {
        padding: 12px 15px;
    }

    .project-finance-band strong {
        font-size: 17px;
    }
}

@media (max-width: 860px) {
    .project-overview {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .project-hero {
        min-height: 0;
    }

    .project-finance-band {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-finance-band > div:nth-child(3) {
        border-top: 1px solid var(--line-strong);
    }

    .project-finance-band > div:nth-child(4) {
        border-top: 1px solid var(--line-strong);
    }

}

@media (max-width: 620px) {
    .project-hero h1 {
        font-size: 50px;
    }

    .project-finance-band {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-finance-band > div,
    .project-finance-band > div:last-child {
        min-height: 88px;
        border-top: 1px solid var(--line-strong);
        border-inline-end: 0;
    }

    .detail-nav {
        gap: 24px;
    }
}

/*
Site address and notes labels in the project form.
The labels remain readable but are not bold.
*/
.project-form [data-field-name="site_address"] > label,
.project-form [data-field-name="notes"] > label {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 100;
}

/*
Entered Persian text in site address and notes.
*/
.project-form textarea[name="site_address"],
.project-form textarea[name="notes"] {
    color: var(--ink);
    font-family: var(--font-persian);
    font-size: 19px;
    font-weight: 400 !important;
    line-height: 1.8;
    letter-spacing: 0;

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
}

/* Stable expense-table geometry in both project payment modes. */
.expense-records {
    width: 100%;
    table-layout: fixed;
}

.expense-records--standard .expense-col-name {
    width: 52%;
}

.expense-records--standard .expense-col-money {
    width: 20%;
}

.expense-records--standard .expense-col-date {
    width: 19%;
    transform: translateX(-120px);
}

.expense-records--client-paid .expense-col-name {
    width: 31%;
}

.expense-records--client-paid .expense-col-money {
    width: 15%;
}

.expense-records--client-paid .expense-col-date {
    width: 15%;
}

.expense-col-actions {
    width: 132px;
}

.expense-column--name {
    transform: translateX(0px);
}
.expense-cell--name {
    text-align: right;
}

.expense-column--money {
    transform: translateX(70px);
}
.expense-cell--money {
    transform: translateX(65px);
}
.expense-column--date,
.expense-cell--date {
    direction: ltr;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Tracking disabled. */
.expense-records--standard .expense-column--date {
    transform: translateX(111px);
}
.expense-records--standard .expense-cell--date {
    transform: translateX(0);
}

/* Tracking enabled. */
.expense-records--client-paid .expense-column--date {
    transform: translateX(79px);
}
.expense-records--client-paid .expense-cell--date {
    transform: translateX(0);
}

/* Larger, clearer expense record text. */
.expense-records td {
    font-family: var(--font-ui);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
}

/* Expense names can contain Persian or English. */
.expense-records .xtx-content-auto {
    font-size: 19px;
    line-height: 1.7;
}

/* Keep cost and date structured and LTR. */
.expense-records .xtx-data-ltr {
    font-size: 17px;
    font-weight: 400;
}

/* Arrow points upward when sorting oldest to newest. */
/*
One fixed actions column on the visual left side of the expense table.
The column remains stable when its buttons are hidden.
*/
.expense-actions-heading,
.expense-actions-cell {
    width: 132px;
    min-width: 132px;
    padding-inline: 8px !important;
    text-align: center;
}

/*
The first column holds the three-dot/Edit/Delete controls.
The second, right-side column holds the number toggle or row number.
*/
/* Header: three dots, bulk delete, and number toggle. */
.expense-heading-controls {
    display: grid;
    grid-template-columns: 34px 34px 34px;
    gap: 5px;
    align-items: center;
    justify-content: center;
    direction: ltr;
}

/* Rows: Edit/Delete actions followed by the optional row number. */
.expense-action-content {
    display: grid;
    grid-template-columns: 74px 34px;
    gap: 8px;
    align-items: center;
    justify-content: center;
    direction: ltr;
}

.expense-actions-toggle {
    grid-column: 1;
    justify-self: center;
}

.expense-bulk-delete-trigger {
    grid-column: 2;
    justify-self: center;

    width: 34px;
    height: 34px;
    min-height: 34px;

    color: var(--danger);
    background: transparent;
    border-color: transparent;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-3px) scale(0.94);

    transition:
        opacity 140ms ease,
        transform 140ms ease,
        visibility 140ms ease,
        background-color 140ms ease,
        border-color 140ms ease;
}

.expense-records.expense-actions-visible
.expense-bulk-delete-trigger {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.expense-bulk-delete-trigger:hover {
    color: #ffffff;
    background: var(--danger);
    border-color: var(--danger);
}

.expense-number-toggle {
    grid-column: 3;
    justify-self: center;

    transform: translateX(-3px);
    transition:
        transform 160ms ease,
        color 140ms ease,
        background-color 140ms ease,
        border-color 140ms ease;
}

.expense-records.expense-actions-visible
.expense-number-toggle {
    transform: translateX(3px);
}

.expense-number-toggle {
    grid-column: 2;
    justify-self: center;

    width: 34px;
    height: 34px;
    min-height: 34px;

    color: var(--muted);
    background: transparent;
    border-color: transparent;
}

.expense-number-toggle span {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 650;
    line-height: 1;
}

.expense-number-toggle:hover,
.expense-number-toggle[aria-expanded="true"] {
    color: var(--ink);
    background: var(--surface-strong);
    border-color: var(--line);
}

.expense-row-actions {
    grid-column: 1;
}

.expense-row-number {
    display: none;
    grid-column: 2;
    justify-self: center;

    width: 34px;
    color: var(--ink-soft);

    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
}

.expense-records.expense-numbers-visible .expense-row-number {
    display: block;
}

.expense-actions-toggle {
    width: 34px;
    height: 34px;
    min-height: 34px;
    color: var(--muted);
    background: transparent;
    border-color: transparent;
}

.expense-actions-toggle:hover,
.expense-actions-toggle[aria-expanded="true"] {
    color: var(--ink);
    background: var(--surface-strong);
    border-color: var(--line);
}

/* Edit and Delete buttons occupy the left column but begin invisible. */
.expense-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    direction: ltr;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-4px);
    transition:
        opacity 140ms ease,
        transform 140ms ease,
        visibility 140ms ease;
}

.expense-row-actions form {
    margin: 0;
}

/* The header toggle adds this class to the complete table. */
.expense-records.expense-actions-visible .expense-row-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.expense-row-actions .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
}

.expense-delete-action {
    color: var(--danger);
}

.expense-delete-action:hover {
    color: #ffffff;
    background: var(--danger);
    border-color: var(--danger);
}

.expense-name-field {
    min-width: 0;
    margin: 0;
    transform: translate(0px, -4.2px);
}

.expense-name-heading {
    display: flex;
    min-height: 22px;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    direction: ltr;
}

.expense-name-heading label {
    margin: 0;
}

.expense-supplier-toggle {
    display: inline-flex;
    width: 26px;
    height: 22px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.expense-supplier-toggle:hover,
.expense-supplier-toggle[aria-expanded="true"] {
    color: var(--primary);
    background: var(--surface-strong);
}

.expense-supplier-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 140ms ease;
}

.expense-supplier-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Supplier fields become a complete second row below the main expense row. */
.expense-supplier-fields {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px);
    gap: 12px;

    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.expense-supplier-fields[hidden] {
    display: none;
}

.expense-supplier-fields .form-field {
    margin: 0;
}

/* Supplier placeholders remain on the left. */
.expense-supplier-fields input:placeholder-shown {
    direction: ltr;
    text-align: left;
}

.expense-supplier-fields input::placeholder {
    direction: ltr;
    text-align: left;
}

@media (max-width: 700px) {
    .expense-supplier-fields {
        grid-template-columns: 1fr;
    }
}

/* Expense edit page: primary fields on row one, supplier on row two. */
.expense-edit-grid {
    display: block;
}

.expense-edit-grid__primary {
    display: grid;
    grid-template-columns:
        minmax(280px, 1fr)
        minmax(160px, 220px)
        180px;
    gap: 16px;
    align-items: start;
    direction: ltr;
}

.expense-edit-grid__primary--split {
    grid-template-columns:
        minmax(260px, 1fr)
        minmax(150px, 210px)
        minmax(150px, 210px)
        180px;
}

.expense-edit-grid__supplier {
    display: grid;
    grid-template-columns:
        minmax(280px, 1fr)
        minmax(160px, 240px);
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    align-items: start;
    direction: ltr;
    border-top: 1px solid var(--line);
}

.expense-edit-grid__primary .form-field,
.expense-edit-grid__supplier .form-field {
    margin: 0;
}

/* Placeholder remains LTR; entered Persian supplier name remains RTL. */
.expense-edit-grid__supplier input:placeholder-shown {
    direction: ltr;
    text-align: left;
}

.expense-edit-grid__supplier input::placeholder {
    direction: ltr;
    text-align: left;
}

.expense-edit-grid__supplier {
    display: grid;
    grid-template-columns:
        minmax(280px, 1fr)
        minmax(160px, 240px);
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    align-items: start;
    direction: ltr;
    border-top: 1px solid var(--line);
}

/* Actual supplier-name input is Persian RTL. */
.expense-supplier-fields input[name="supplier_name"]:not(:placeholder-shown) {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

@media (max-width: 850px) {
    .expense-edit-grid__primary,
    .expense-edit-grid__supplier {
        grid-template-columns: 1fr;
    }
}

.expense-heading-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;

    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
}

.expense-heading-sort:hover {
    color: var(--ink);
}

.expense-heading-sort:focus-visible {
    border-radius: 2px;
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.expense-sort-arrow {
    color: var(--ink-soft);
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
}

.expense-heading-sort.is-active
.expense-sort-arrow {
    color: var(--ink);
}

.expense-sort-arrow[hidden] {
    display: none;
}

.expense-column--date
.expense-heading-sort {
    direction: ltr;
}

.installation-dashboard--setup {
    min-width: 0;
}

.installation-summary--setup {
    margin: 0;
}

@media (max-width: 980px) {
    }

@media (max-width: 720px) {
    }

/* Initialized installation dashboard */

.installation-dashboard {
    display: grid;
    gap: 16px;
}

.installation-edit-toggle {
    display: inline-grid;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex: 0 0 36px;
    place-items: center;
    padding: 0;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    box-shadow: none;
    cursor: pointer;
}

.installation-edit-toggle:hover,
.installation-edit-toggle[aria-expanded="true"] {
    background: var(--surface-strong);
}

.installation-edit-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.installation-edit-toggle svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.7;
}

.installation-schedule-editor {
    display: grid;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.installation-schedule-editor[hidden],
.installation-summary[hidden] {
    display: none;
}

.installation-schedule-editor__header {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
}

.installation-schedule-editor__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}

.installation-schedule-editor__cancel {
    padding: 4px 0;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.installation-schedule-editor__cancel:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.installation-schedule-editor__fields {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 1fr)
        auto;
    align-items: end;
    padding: 16px;
}

.installation-schedule-editor__field {
    display: grid;
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-inline-end: 1px solid var(--line);
}

.installation-schedule-editor__field:first-child {
    padding-inline-start: 0;
}

.installation-schedule-editor__icon {
    display: grid;
    place-items: center;
    color: var(--ink-soft);
}

.installation-schedule-editor__icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.7;
}

.installation-schedule-editor__field .form-field {
    display: grid;
    min-width: 0;
    gap: 5px;
    margin: 0;
}

.installation-schedule-editor__field label {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
}

.installation-schedule-editor__field input,
.installation-schedule-editor__field select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font: inherit;
}

.installation-schedule-editor__field input:focus,
.installation-schedule-editor__field select:focus {
    border-color: var(--accent);
    outline: 1px solid var(--accent);
    outline-offset: 0;
}

.installation-schedule-editor__field small {
    color: var(--muted);
    font-size: 10px;
}

.installation-schedule-editor__field .errorlist {
    margin: 0;
    padding: 0;
    color: var(--danger);
    font-size: 10px;
    list-style: none;
}

.installation-schedule-editor__actions {
    display: flex;
    align-items: flex-end;
    padding-inline-start: 20px;
}

.installation-schedule-editor__actions .button {
    min-width: 132px;
    min-height: 40px;
    white-space: nowrap;
}

.installation-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 84px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.installation-summary__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 16px 20px;
}

.installation-summary__item + .installation-summary__item::before {
    position: absolute;
    inset-block: 16px;
    inset-inline-start: 0;
    width: 1px;
    background: var(--line);
    content: "";
}

.installation-summary__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--ink-soft);
}

.installation-summary__icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.5;
}

.installation-summary__copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.installation-summary__copy small {
    color: var(--ink-muted);
    font-size: 12px;
}

.installation-summary__copy strong {
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
}

.installation-status {
    justify-self: start;
    padding: 3px 9px;
    color: var(--ink-soft);
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.35;
}

.installation-status--in_progress {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: color-mix(
        in srgb,
        var(--accent) 30%,
        var(--line)
    );
}

.installation-status--completed {
    color: #397249;
    background: #e5f1e7;
    border-color: #b9d5c0;
}

.installation-status--cancelled {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: color-mix(
        in srgb,
        var(--danger) 30%,
        var(--line)
    );
}

[data-theme="dark"] .installation-status--completed {
    color: #9dd7aa;
    background: #183021;
    border-color: #315b3c;
}

.installation-description {
    margin: 0;
    padding: 10px 14px;
    color: var(--ink-soft);
    background: var(--surface-subtle);
    border-inline-start: 3px solid var(--accent);
}

.installation-dashboard__layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.installation-dashboard__sidebar {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.installation-dashboard__main {
    min-width: 0;
}

.installation-panel,
.installation-day-card,
.installation-ledger {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.installation-panel {
    padding: 14px;
}

.installation-panel__header,
.installation-ledger__heading,
.installation-day-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.installation-panel__header {
    margin-bottom: 10px;
}

.installation-panel__header h3,
.installation-day-card__header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
}

.installation-ledger__heading h4,
.installation-work-completed h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
}

.installation-team-list {
    display: grid;
}

.installation-team-member {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 46px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.installation-team-member:last-child {
    border-bottom: 0;
}

.installation-team-member.is-inactive {
    opacity: 0.55;
}

.installation-team-member__icon {
    display: grid;
    place-items: center;
    color: var(--ink-soft);
}

.installation-team-member__icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

.installation-team-member__name {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.installation-team-member__name--link {
    width: max-content;
    max-width: 100%;
    cursor: pointer;
    text-decoration: none;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.installation-team-member__name--link:hover {
    text-decoration-line: underline;
}

.installation-team-member__name--link:focus-visible {
    border-radius: 2px;
    outline: 2px solid color-mix(
        in srgb,
        var(--accent) 48%,
        transparent
    );
    outline-offset: 3px;
    text-decoration-line: underline;
}

.installation-role-badge {
    padding: 3px 8px;
    color: var(--ink-soft);
    background: var(--surface-subtle);
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
}

.installation-day-list {
    display: grid;
    gap: 7px;
    background: transparent;
}

.installation-day-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 9px 11px;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 3px solid transparent;
    border-radius: 3px;
    text-decoration: none;
}

.installation-day-link:hover {
    color: var(--ink);
    background: var(--surface-subtle);
}

.installation-day-link.is-active {
    color: var(--ink);
    background: color-mix(
        in srgb,
        var(--warning, #a87308) 12%,
        var(--surface)
    );
    border-color: color-mix(
        in srgb,
        var(--warning, #a87308) 32%,
        var(--line)
    );
    border-inline-start-color: var(--warning, #a87308);
}

.installation-day-link svg {
    width: 18px;
    height: 18px;
    color: currentColor;
    stroke-width: 1.5;
}

.installation-action {
    position: relative;
}

.installation-action > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    list-style: none;
    white-space: nowrap;
}

.installation-action > summary::-webkit-details-marker {
    display: none;
}

.installation-action > summary svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.6;
}

.installation-action--day {
    margin-top: 14px;
    text-align: end;
}

.installation-popover-form {
    position: absolute;
    z-index: 30;
    inset-inline-end: 0;
    top: calc(100% + 10px);
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 48px));
    padding: 16px;
    text-align: start;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.installation-popover-form--wide {
    width: min(720px, calc(100vw - 48px));
}

.installation-entry-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.installation-form-actions {
    display: flex;
    justify-content: flex-end;
}

.installation-day-card {
    min-width: 0;
    overflow: visible;
}

.installation-day-card__header {
    padding: 14px 16px;
}

.installation-work-completed {
    margin: 0 16px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--line);
}

.installation-work-completed p {
    margin: 5px 0 0;
    color: var(--ink);
}

.installation-ledger {
    margin: 14px 16px 0;
    overflow: visible;
}

.installation-ledger__heading {
    min-height: 34px;
    padding: 0 0 8px;
}

.installation-cost-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 16px 0;
}

.installation-cost-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
}

.installation-cost-panel .installation-ledger__heading {
    padding: 10px 12px 4px;
}

.installation-cost-table {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.installation-cost-table__header,
.installation-cost-table__row {
    display: grid;
    align-items: center;
    min-width: 0;
}

.installation-cost-table--meals
    .installation-cost-table__header,
.installation-cost-table--meals
    .installation-cost-table__row {
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(76px, 0.55fr)
        minmax(120px, 0.8fr);
}

.installation-cost-table--transport
    .installation-cost-table__header,
.installation-cost-table--transport
    .installation-cost-table__row {
    grid-template-columns:
        minmax(110px, 0.9fr)
        minmax(0, 1.45fr)
        minmax(120px, 0.8fr);
}

.installation-cost-table__header {
    min-height: 36px;
    color: var(--ink-muted);
    background: color-mix(
        in srgb,
        var(--surface) 92%,
        var(--ink) 8%
    );
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
}

.installation-cost-table__header > *,
.installation-cost-table__row > * {
    min-width: 0;
    padding: 8px 10px;
}

.installation-cost-table__header > :last-child,
.installation-cost-table__row > :last-child {
    text-align: end;
}

.installation-cost-table__row {
    min-height: 39px;
    font-size: 13px;
}

.installation-cost-table__row + .installation-cost-table__row {
    border-top: 1px solid var(--line);
}

.installation-cost-table__row strong {
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.installation-cost-table__row bdi {
    font-variant-numeric: tabular-nums;
}

.installation-cost-table__details {
    overflow: hidden;
    color: var(--ink-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.installation-cost-table__total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 42px;
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.installation-cost-table__total bdi {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.installation-cost-table__body
    > .installation-empty-copy {
    margin: 0;
    padding: 22px 10px;
    text-align: center;
}

.installation-cost-panel__action {
    align-self: center;
    margin: 10px 0 12px;
}

.installation-cost-panel__action > summary {
    justify-content: center;
}

.installation-day-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
    padding: 13px 16px;
    background: var(--surface-subtle);
    border-top: 1px solid var(--line);
}

.installation-day-total > span {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
}

.installation-day-total bdi {
    font-family: var(--font-display);
    font-size: 21px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.installation-day-total small {
    color: var(--ink-soft);
}

.installation-empty-copy {
    margin: 10px 0;
    color: var(--ink-muted);
    font-size: 12px;
}

.installation-no-day {
    display: grid;
    place-items: center;
    min-height: 320px;
    padding: 40px;
    text-align: center;
}

.installation-no-day > svg {
    width: 30px;
    height: 30px;
    color: var(--accent);
}

.installation-no-day h3 {
    margin: 12px 0 0;
}

.installation-no-day p {
    max-width: 42ch;
    margin: 6px 0 0;
    color: var(--ink-soft);
}

@media (max-width: 1050px) {
    .installation-dashboard__layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    }

@media (max-width: 860px) {
    .installation-summary {
        grid-template-columns: 1fr;
    }

    .installation-summary__item + .installation-summary__item::before {
        inset-block: 0 auto;
        inset-inline: 16px;
        width: auto;
        height: 1px;
    }

    .installation-dashboard__layout {
        grid-template-columns: 1fr;
    }

    .installation-dashboard__sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .installation-cost-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .installation-dashboard__sidebar {
        grid-template-columns: 1fr;
    }

    .installation-cost-table__header {
        display: none;
    }

    .installation-cost-table--meals
        .installation-cost-table__row,
    .installation-cost-table--transport
        .installation-cost-table__row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .installation-cost-table--meals
        .installation-cost-table__row
        > :nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        color: var(--ink-muted);
        font-size: 12px;
    }

    .installation-cost-table--meals
        .installation-cost-table__row
        > :nth-child(3) {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .installation-cost-table--transport
        .installation-cost-table__row
        > :nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .installation-cost-table--transport
        .installation-cost-table__row
        > :nth-child(3) {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

    .installation-summary__item {
        padding: 14px;
    }

    .installation-day-card__header {
        align-items: flex-start;
    }

    .installation-entry-form-grid {
        grid-template-columns: 1fr;
    }

    .installation-cost-grid {
        margin-inline: 12px;
    }

    .installation-work-completed,
    .installation-ledger {
        margin-inline: 12px;
    }

    .installation-day-total {
        align-items: flex-start;
        flex-direction: column;
    }

    .installation-popover-form,
    .installation-popover-form--wide {
        position: fixed;
        z-index: 100;
        inset: 16px;
        width: auto;
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
    }
}

/* Installer detail page */

.installation-member-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 28px;
    padding: 4px 7px;
    color: var(--accent);
    background: transparent;
    border: 1px solid color-mix(
        in srgb,
        var(--accent) 30%,
        var(--line)
    );
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .installation-team-member {
        grid-template-columns: 24px minmax(0, 1fr) auto;
    }

    }

.installer-detail-page {
    display: grid;
    gap: 0;
    width: 100%;
    color: var(--ink);
}

.project-context-path {
    position: sticky;
    z-index: 25;
    top: var(--topbar-height);
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: -14px 0 18px;
    padding: 12px 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    background: var(--canvas);
    border-bottom: 1px solid transparent;
    font-size: 13px;
    line-height: 1.3;
}

.project-context-path a {
    color: var(--accent);
    text-decoration: none;
}

.project-context-path a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.project-context-path > span[aria-hidden="true"] {
    color: var(--line-strong);
}

.project-context-path > span[aria-current="page"] {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-context-path::before {
    position: absolute;
    z-index: -1;
    top: 0;
    right: -2px;
    bottom: 0;
    left: -2px;
    content: "";
    background: var(--canvas);
}

.installer-breadcrumbs::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    content: "";
    background: var(--line);
    opacity: 0;
    transition: opacity 150ms ease;
}

/* Breadcrumb link styling is shared through .project-context-path. */

#installation-team {
    scroll-margin-top: calc(
        var(--topbar-height) + 24px
    );
}

.installer-detail-header {
    margin-bottom: 18px;
}

.installer-detail-heading {
    display: grid;
    gap: 10px;
}

.installer-detail-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.installer-detail-title-row h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(32px, 3vw, 42px);
    font-weight: 500;
    line-height: 1.05;
}

.installer-detail-role {
    padding: 5px 10px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(
        in srgb,
        var(--accent) 28%,
        var(--line)
    );
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.2;
}

.installer-back-link {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 8px;
    color: var(--accent);
    font-size: 13px;
    text-decoration: none;
}

.installer-back-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.installer-back-link svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

.installer-identity-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 86px;
    margin-bottom: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.installer-identity-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    padding: 16px 22px;
}

.installer-identity-item + .installer-identity-item::before {
    position: absolute;
    inset-block: 16px;
    inset-inline-start: 0;
    width: 1px;
    background: var(--line);
    content: "";
}

.installer-identity-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--ink-soft);
}

.installer-identity-icon svg {
    width: 27px;
    height: 27px;
    stroke-width: 1.4;
}

.installer-identity-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.installer-identity-copy small {
    color: var(--ink-muted);
    font-size: 12px;
}

.installer-identity-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.installer-status-dot {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    background: var(--accent);
    border-radius: 50%;
}

.installer-status-dot--inactive {
    background: var(--ink-muted);
}

.installer-payment-section {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.installer-payment-label {
    margin: 0 0 8px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
}

.installer-payment-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(366px, 100%);
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
}

.installer-payment-tab {
    min-height: 36px;
    padding: 7px 16px;
    color: var(--ink);
    background: var(--surface);
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.installer-payment-tab + .installer-payment-tab {
    border-inline-start: 1px solid var(--line-strong);
}

.installer-payment-tab:hover {
    background: var(--surface-subtle);
}

.installer-payment-tab.is-active {
    color: #ffffff;
    background: var(--accent);
}

.installer-payment-tab:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid color-mix(
        in srgb,
        var(--accent) 45%,
        transparent
    );
    outline-offset: -3px;
}

.installer-payment-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    margin-bottom: 14px;
}

.installer-payment-card {
    min-width: 0;
    padding: 20px 22px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    opacity: 0.66;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease,
        opacity 140ms ease;
}

.installer-payment-card.is-active {
    border-color: var(--line-strong);
    box-shadow: inset 0 0 0 1px color-mix(
        in srgb,
        var(--accent) 7%,
        transparent
    );
    opacity: 1;
}

.installer-payment-card__header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 17px;
}

.installer-payment-card__header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
}

.installer-payment-radio {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 21px;
    height: 21px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
}

.installer-payment-card.is-active .installer-payment-radio {
    border: 2px solid var(--accent);
}

.installer-payment-card.is-active .installer-payment-radio::after {
    width: 11px;
    height: 11px;
    background: var(--accent);
    border-radius: 50%;
    content: "";
}

.installer-payment-card__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.installer-detail-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.installer-detail-field > span {
    color: var(--ink);
    font-size: 12px;
}

.installer-detail-field input,
.installer-imprest-entry input {
    width: 100%;
    min-width: 0;
    min-height: 41px;
    padding: 8px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    font: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.installer-detail-field input::placeholder,
.installer-imprest-entry input::placeholder {
    color: var(--ink-muted);
}

.installer-detail-field input:focus,
.installer-imprest-entry input:focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(
        in srgb,
        var(--accent) 18%,
        transparent
    );
    outline-offset: 0;
}

.installer-detail-field input:disabled {
    color: var(--ink-muted);
    background: var(--surface-subtle);
    cursor: not-allowed;
}

.installer-imprest-section {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    padding-top: 14px;
}

.installer-imprest-section > form,
.installer-imprest-table-wrap,
.installer-imprest-table {
    width: 100%;
    max-width: none;
}

.installer-imprest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.installer-imprest-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 500;
}

.installer-imprest-header p {
    margin: 2px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.installer-imprest-table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.installer-imprest-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 13px;
}

.installer-imprest-table th,
.installer-imprest-table td {
    min-height: 48px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    text-align: start;
    vertical-align: middle;
}

.installer-imprest-table thead th {
    color: var(--ink);
    background: var(--surface-subtle);
    font-weight: 500;
}

.installer-imprest-actions-column {
    width: 150px;
    text-align: center !important;
}

.installer-imprest-table th:nth-child(1),
.installer-imprest-table td:nth-child(1),
.installer-imprest-table th:nth-child(2),
.installer-imprest-table td:nth-child(2) {
    width: calc((100% - 150px) / 2);
}

.installer-imprest-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.installer-row-action {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
}

.installer-row-action:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.installer-row-action svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

.installer-imprest-empty {
    height: 58px;
    color: var(--ink-muted);
    text-align: center !important;
}

.installer-imprest-entry {
    background: var(--surface-subtle);
}

.installer-imprest-entry td {
    padding-block: 9px;
}

.installer-imprest-entry__actions {
    width: 150px;
    text-align: center !important;
    white-space: nowrap;
}

.installer-imprest-control {
    width: 100%;
    max-width: 282px;
    min-width: 220px;
}

.installer-imprest-control > input,
.installer-imprest-control > .jalali-date-control,
.installer-imprest-control .jalali-date-input {
    width: 100%;
}

.installer-imprest-table tfoot th,
.installer-imprest-table tfoot td {
    padding-block: 14px;
    background: var(--surface);
    border-bottom: 0;
}

.installer-imprest-table tfoot th {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
}

.installer-imprest-table tfoot td {
    text-align: end;
}

.installer-imprest-table tfoot strong {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
}

.installer-imprest-table tfoot bdi {
    font-variant-numeric: tabular-nums;
}

.installer-imprest-table tfoot small {
    font-size: 16px;
    font-weight: 400;
}

@media (max-width: 900px) {
    .installer-identity-card {
        grid-template-columns: 1fr;
    }

    .installer-identity-item + .installer-identity-item::before {
        inset-block: 0 auto;
        inset-inline: 20px;
        width: auto;
        height: 1px;
    }

    .installer-payment-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 620px) {
    .installer-detail-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .installer-detail-title-row h1 {
        font-size: 32px;
    }

    .installer-identity-item {
        padding-inline: 16px;
    }

    .installer-payment-tabs {
        width: 100%;
    }

    .installer-payment-card {
        padding: 16px;
    }

    .installer-payment-card__fields {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .installer-imprest-header {
        align-items: stretch;
        flex-direction: column;
    }

    .installer-imprest-header .button {
        justify-content: center;
        width: 100%;
    }
}

/* Outsourced services */

.outsourced-services-intro {
    max-width: 560px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.outsourced-service-card__icon,
.outsourced-form-heading__icon,
.outsourced-detail-summary__icon,
.outsourced-empty-state__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 9%, transparent);
    border-radius: 50%;
}

.outsourced-service-card__icon svg,
.outsourced-form-heading__icon svg,
.outsourced-detail-summary__icon svg,
.outsourced-empty-state__icon svg {
    width: 20px;
    height: 20px;
}

.outsourced-muted-value {
    color: var(--muted);
    font-weight: 400;
}

.outsourced-status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
}

.outsourced-status--sent {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
}

.outsourced-status--in_progress {
    color: var(--rust);
    background: color-mix(in srgb, var(--rust) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--rust) 30%, var(--line));
}

.outsourced-status--completed {
    color: #2f7155;
    background: color-mix(in srgb, #2f7155 10%, var(--surface));
    border-color: color-mix(in srgb, #2f7155 28%, var(--line));
}

.outsourced-status--cancelled {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 25%, var(--line));
}

.outsourced-empty-state {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.outsourced-empty-state h3 {
    margin: 0 0 5px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
}

.outsourced-empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

/* Outsourced service form */

.outsourced-service-editor {
    width: min(100%, 1240px);
    margin-inline: auto;
}

.outsourced-service-editor .project-hero {
    padding-bottom: 28px;
}

.outsourced-service-editor .project-hero h1 {
    max-width: none;
    font-family: var(--font-display);
    font-size: clamp(42px, 4.5vw, 64px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.035em;
}

.outsourced-service-editor .page-summary {
    max-width: 650px;
    margin-top: 12px;
}

.outsourced-service-form {
    display: grid;
    gap: 14px;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.outsourced-service-form .editor-section {
    display: block;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.outsourced-service-form__items {
    margin-top: 0;
}

.outsourced-form-heading,
.outsourced-form-heading__copy {
    display: flex;
    align-items: center;
    gap: 14px;
}

.outsourced-form-heading {
    margin-bottom: 18px;
}

.outsourced-form-heading--actions {
    justify-content: space-between;
}

.outsourced-form-heading__copy {
    min-width: 0;
}

.outsourced-form-heading__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: transparent;
    border-radius: 0;
}

.outsourced-form-heading__icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.6;
}

.outsourced-form-heading h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 500;
    line-height: 1.15;
}

.outsourced-form-heading__description {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

/*
Provider:
- Provider name: 2/3 width
- Status: 1/3 width
- Three dates: equal widths
*/

.outsourced-service-fields {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px 20px;
    align-items: end;
}

.outsourced-service-fields > :nth-child(1) {
    grid-column: span 4;
}

.outsourced-service-fields > :nth-child(2) {
    grid-column: span 2;
}

.outsourced-service-fields > :nth-child(3),
.outsourced-service-fields > :nth-child(4),
.outsourced-service-fields > :nth-child(5) {
    grid-column: span 2;
}

.outsourced-service-form .form-field {
    min-width: 0;
}

.outsourced-service-form .form-field > label {
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    text-align: start;
}

.outsourced-service-form
    .form-field
    input:not([type="checkbox"]):not([type="radio"]),
.outsourced-service-form .form-field select {
    width: 100%;
    min-height: 45px;
    padding-inline: 13px;
    background: var(--surface);
}

.outsourced-item-list {
    display: grid;
    gap: 10px;
}

.outsourced-item-form {
    padding: 14px 20px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.outsourced-item-form[hidden] {
    display: none;
}

.outsourced-item-form__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 0;
}

.outsourced-item-number {
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.outsourced-item-remove {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: var(--muted);
    background: transparent;
    border-color: transparent;
}

.outsourced-item-remove:hover {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: transparent;
}

.outsourced-item-form__fields {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.4fr)
        minmax(180px, 1.4fr)
        minmax(90px, 0.65fr)
        minmax(130px, 0.9fr)
        minmax(170px, 1.1fr);
    gap: 14px;
    align-items: start;
}

.outsourced-item-cost-field {
    display: grid;
    min-width: 0;
}

.outsourced-item-cost-field > small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3;
    text-align: start;
}

.outsourced-delete-field {
    display: none;
}

.outsourced-item-remove:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

/* Non-sticky form footer */

.outsourced-service-form .editor-actions {
    position: static;
    z-index: auto;
    justify-content: flex-end;
    min-height: 64px;
    margin-top: 4px;
    padding: 16px 0 0;
    background: transparent;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.outsourced-service-form .editor-actions__buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    width: 100%;
}

/* Outsourced service detail */

.outsourced-detail-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.outsourced-detail-title h1 {
    margin: 0;
}

.outsourced-detail-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.outsourced-detail-summary__item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 22px 24px;
    border-right: 1px solid var(--line);
}

.outsourced-detail-summary__item:last-child {
    border-right: 0;
}

.outsourced-detail-summary__item small {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
}

.outsourced-detail-summary__item strong {
    display: block;
    font-size: 14px;
    font-weight: 650;
}

.outsourced-items-table th:nth-child(3),
.outsourced-items-table td:nth-child(3),
.outsourced-items-table th:nth-child(4),
.outsourced-items-table td:nth-child(4),
.outsourced-items-table th:nth-child(5),
.outsourced-items-table td:nth-child(5) {
    text-align: right;
}

.outsourced-items-table tfoot th,
.outsourced-items-table tfoot td {
    padding-top: 16px;
    padding-bottom: 16px;
    border-top: 1px solid var(--ink);
}

.outsourced-detail-danger {
    display: flex;
    justify-content: flex-end;
    padding-top: 0;
}

@media (max-width: 1100px) {
    .outsourced-service-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .outsourced-service-fields > :nth-child(1),
    .outsourced-service-fields > :nth-child(2),
    .outsourced-service-fields > :nth-child(3),
    .outsourced-service-fields > :nth-child(4) {
        grid-column: span 1;
    }

    .outsourced-service-fields > :nth-child(5) {
        grid-column: 1 / -1;
    }

    .outsourced-item-form__fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .outsourced-item-cost-field {
        grid-column: 1 / -1;
    }

    .outsourced-detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .outsourced-detail-summary__item:nth-child(2) {
        border-right: 0;
    }

    .outsourced-detail-summary__item:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 720px) {
    .outsourced-empty-state {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .outsourced-empty-state .button {
        grid-column: 1 / -1;
        justify-content: center;
        width: 100%;
    }

    .outsourced-form-heading--actions {
        align-items: stretch;
        flex-direction: column;
    }

    .outsourced-form-heading--actions .button {
        justify-content: center;
        width: 100%;
    }

    .outsourced-service-editor .project-hero h1 {
        font-size: 40px;
    }

    .outsourced-service-form .editor-section {
        padding: 18px;
    }

    .outsourced-service-fields,
    .outsourced-item-form__fields,
    .outsourced-detail-summary {
        grid-template-columns: 1fr;
    }

    .outsourced-service-fields > :nth-child(n),
    .outsourced-item-cost-field {
        grid-column: auto;
    }

    .outsourced-item-form {
        padding: 14px;
    }

    .outsourced-service-form .editor-actions__buttons {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .outsourced-service-form .editor-actions .button {
        justify-content: center;
        width: 100%;
    }

    .outsourced-detail-summary__item,
    .outsourced-detail-summary__item:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .outsourced-detail-summary__item:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 760px) {
    .project-context-path {
        min-height: 42px;
        margin-top: -8px;
        padding-block: 9px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .project-context-path::-webkit-scrollbar {
        display: none;
    }

    .project-context-path > * {
        flex: 0 0 auto;
    }

    .project-context-path > span[aria-current="page"] {
        overflow: visible;
        text-overflow: clip;
    }
}

@media (max-width: 980px) {
    .installation-schedule-editor__fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .installation-schedule-editor__field {
        padding: 0 0 16px;
        border-inline-end: 0;
        border-bottom: 1px solid var(--line);
    }

    .installation-schedule-editor__actions {
        justify-content: flex-end;
        padding-inline-start: 0;
    }
}

@media (max-width: 620px) {
    .installation-edit-toggle {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        flex-basis: 34px;
    }

    .installation-schedule-editor__actions .button {
        width: 100%;
    }
}

/* Project item entry
   ---------------------------------------------------------- */

.item-entry-project-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 12px 0 22px;
}

.item-entry-project-header .eyebrow {
    margin: 0 0 4px;
}

.item-entry-project-header h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.05;
    unicode-bidi: plaintext;
}

.item-entry-project-nav {
    margin-bottom: 0;
}

.item-entry-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    align-items: stretch;
    margin-top: 0;
    border-bottom: 1px solid var(--line);
}

.item-entry-main {
    min-width: 0;
    padding: 24px 16px 0 0;
    border-right: 1px solid var(--line);
}

.item-entry-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 16px;
}

.item-entry-heading .section-kicker {
    margin: 0 0 5px;
}

.item-entry-heading h2 {
    margin: 0;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.item-entry-heading > div > p:last-child {
    max-width: 580px;
    margin: 8px 0 0;
    color: var(--muted);
}

.item-entry-progress {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.item-entry-progress li {
    position: relative;
    display: flex;
    min-width: 74px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
}

.item-entry-progress li:not(:last-child)::after {
    width: 34px;
    height: 1px;
    margin-left: 10px;
    background: var(--line-strong);
    content: "";
}

.item-entry-progress strong {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.item-entry-progress .is-current {
    color: var(--ink);
}

.item-entry-progress .is-current strong {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
}

.item-entry-progress .is-complete {
    color: var(--ink-soft);
}

.item-entry-progress__check {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    color: #fff;
    background: #409b82;
    border-radius: 50%;
}

.item-entry-progress__check svg {
    width: 15px;
    height: 15px;
}

.item-entry-form {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px 7px 0 0;
}

.item-entry-form .error-list,
.item-entry-form .form-errors {
    margin: 16px 18px 0;
}

.item-entry-section + .item-entry-section {
    border-top: 1px solid var(--line);
}

.item-entry-section__header {
    padding: 14px 18px 0;
}

.item-entry-section__header h3 {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.item-entry-grid {
    display: grid;
    gap: 14px 18px;
    padding: 10px 18px 18px;
}

.item-entry-grid--classification {
    grid-template-columns:
        minmax(160px, 1fr)
        minmax(160px, 1fr)
        minmax(160px, 1fr)
        auto;
    align-items: end;
}

.item-entry-grid--identity {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-entry-grid--quantity {
    grid-template-columns:
        minmax(180px, 0.75fr)
        minmax(180px, 0.55fr)
        minmax(260px, 1.7fr);
    align-items: end;
}

.item-entry-grid--project-use {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.item-entry-field {
    min-width: 0;
}

.item-entry-field--wide {
    grid-column: 1 / -1;
}

.item-entry-field label {
    display: flex;
    min-height: 17px;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 6px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 650;
}

.item-entry-field input,
.item-entry-field select,
.item-entry-field textarea {
    width: 100%;
    min-height: 40px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
}

.item-entry-field textarea {
    min-height: 76px;
    resize: vertical;
}

.item-entry-field input[readonly],
.item-entry-field select:disabled {
    color: var(--ink-soft);
    background: var(--surface-subtle);
    cursor: default;
    opacity: 1;
}

.item-entry-field.has-error input,
.item-entry-field.has-error select,
.item-entry-field.has-error textarea {
    border-color: var(--danger);
}

.item-entry-optional {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    text-transform: none;
}

.item-entry-field .required-seal {
    color: var(--danger);
    font-size: 12px;
}

.item-entry-field .field-help {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.item-entry-field .field-error {
    margin: 5px 0 0;
    color: var(--danger);
    font-size: 11px;
    font-weight: 600;
}

.item-entry-change-type {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 6px;
    padding: 0 3px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.item-entry-change-type:hover {
    color: var(--accent);
}

.item-entry-change-type svg {
    width: 14px;
    height: 14px;
}

.item-entry-quantity-help {
    align-self: center;
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 12px;
}

.item-entry-specifications {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 10px 18px 18px;
}

.item-entry-specification {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.item-entry-specification:has(.item-entry-field--unit) {
    grid-template-columns: minmax(0, 1fr) 92px;
}

.item-entry-field--unit label {
    color: var(--muted);
}

.item-entry-section__empty {
    margin: 0;
    padding: 15px 18px 20px;
    color: var(--muted);
    font-size: 12px;
}

.item-type-guide {
    padding: 25px 20px;
    background: var(--surface-subtle);
}

.item-type-guide > h3 {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.item-type-guide__summary {
    display: grid;
    gap: 10px;
    margin: 0;
}

.item-type-guide__summary div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.item-type-guide__summary dt {
    color: var(--muted);
    font-size: 11px;
}

.item-type-guide__summary dd {
    margin: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.item-type-guide__explanation {
    margin: 22px 0 0;
    padding: 20px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    line-height: 1.55;
}

.item-type-guide__others {
    margin-top: 20px;
}

.item-type-guide__others h4 {
    margin: 0 0 10px;
    color: var(--ink-soft);
    font-size: 12px;
}

.item-type-guide__others ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.item-type-guide__others a {
    color: var(--ink);
    font-size: 12px;
}

.item-type-guide__others a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.item-entry-action-bar {
    position: sticky;
    z-index: 12;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 calc(-1 * var(--page-padding, 32px));
    padding: 12px var(--page-padding, 32px);
    background: color-mix(
        in srgb,
        var(--surface) 96%,
        transparent
    );
    border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.item-entry-validation {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #28725f;
    font-size: 12px;
    font-weight: 650;
}

.item-entry-validation svg {
    width: 18px;
    height: 18px;
}

.item-entry-form:has(.field-error) + * .item-entry-validation,
.item-entry-validation:has([data-lucide="circle-alert"]) {
    color: var(--danger);
}

.item-entry-action-bar__buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-type-selection {
    max-width: 920px;
    margin: 26px auto 0;
}

.item-type-selection__form {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.item-type-selection__form .item-entry-field {
    max-width: 560px;
}

.item-type-selection__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

/* Dark-mode geometry remains identical. */

html[data-theme="dark"] .item-entry-main,
html[data-theme="dark"] .item-type-guide,
html[data-theme="dark"] .item-entry-form,
html[data-theme="dark"] .item-type-selection__form {
    border-color: var(--line);
}

html[data-theme="dark"] .item-entry-validation {
    color: #75c9ae;
}

/* Responsive project-item entry. */

@media (max-width: 1180px) {
    .item-entry-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .item-entry-main {
        padding-right: 0;
        border-right: 0;
    }

    .item-type-guide {
        border-top: 1px solid var(--line);
    }

    .item-entry-grid--classification {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .item-entry-grid--identity,
    .item-entry-specifications {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .item-entry-project-header,
    .item-entry-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .item-entry-progress {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .item-entry-grid--classification,
    .item-entry-grid--identity,
    .item-entry-grid--quantity,
    .item-entry-grid--project-use,
    .item-entry-specifications {
        grid-template-columns: minmax(0, 1fr);
    }

    .item-entry-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .item-entry-action-bar__buttons {
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .item-entry-main {
        padding-top: 18px;
    }

    .item-entry-grid,
    .item-entry-specifications {
        padding-right: 14px;
        padding-left: 14px;
    }

    .item-entry-action-bar__buttons {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .item-entry-action-bar__buttons .button {
        width: 100%;
    }
}