/* ============================================================
   MyShipment · Landing Cost Sourcing & Calculation Stylesheet
   Integrated with MyShipment Design System (Tokens & Theme)
   ============================================================ */

/* --- Workspace Layout --- */
.lc-workspace {
    display: grid;
    grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .lc-workspace {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --- Form Column & Step Cards --- */
.lc-form-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lc-form-col fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.lc-step-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-card);
}

.lc-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.lc-step-num {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--indigo);
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.lc-step-note {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--muted);
}

.req-star {
    color: var(--bad);
    font-weight: 700;
}

/* --- Form Fields --- */
.lc-field {
    margin-bottom: 14px;
}

.lc-field:last-child {
    margin-bottom: 0;
}

.lc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.lc-field-row:last-child {
    margin-bottom: 0;
}

.lc-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.lc-field label.req::after {
    content: " *";
    color: var(--bad);
    font-weight: 700;
}

.lc-input,
.lc-select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: var(--font-ui);
    color: var(--ink);
    background: var(--card);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
    box-sizing: border-box;
}

.lc-input:focus,
.lc-select:focus {
    outline: none;
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px var(--indigo-soft);
}

.lc-input::placeholder {
    color: var(--faint);
}

.lc-hint {
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.4;
}

.lc-hs-check {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 5px;
    color: var(--ok);
}

.lc-hs-check.bad {
    color: var(--bad);
}

.lc-hs-check:empty {
    display: none;
}

/* --- Needs Box (Unit Measurements) --- */
.lc-needs-box {
    background: var(--warn-soft);
    border: 1px solid var(--warn-line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--warn);
}

.lc-needs-box b {
    display: block;
    color: var(--ink);
    margin-bottom: 4px;
    font-size: 13px;
}

.lc-needs-box p {
    margin: 0 0 10px 0;
    color: var(--ink-soft);
    line-height: 1.4;
}

.lc-unit-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.lc-unit-row span {
    font-weight: 600;
    color: var(--ink);
    font-size: 12px;
}

/* --- Scenario / Origin Cards --- */
.lc-origin-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    background: var(--paper);
    transition: border-color 0.15s var(--ease);
}

.lc-origin-card:hover {
    border-color: var(--indigo-line);
}

.lc-origin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.lc-origin-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.lc-text-btn {
    border: none;
    background: transparent;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.lc-text-btn:hover {
    color: var(--bad);
    background: var(--bad-soft);
}

.lc-origin-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    align-items: end;
}

.lc-money-box {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--card);
    overflow: hidden;
    margin-top: 4px;
}

.lc-money-box:focus-within {
    border-color: var(--indigo);
    box-shadow: 0 0 0 2px var(--indigo-soft);
}

.lc-money-cur {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--paper-deep);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-code);
    border-right: 1px solid var(--line);
    user-select: none;
}

.lc-money-input {
    border: none;
    border-radius: 0;
    padding: 8px 10px;
    font-family: var(--font-code);
    font-size: 13px;
    width: 100%;
    color: var(--ink);
    background: transparent;
}

.lc-money-input:focus {
    outline: none;
}

/* --- Other Charges Section --- */
.lc-extra-costs {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.lc-extra-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
}

.lc-link-btn {
    border: none;
    background: transparent;
    padding: 2px 4px;
    color: var(--indigo);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
}

.lc-link-btn:hover {
    text-decoration: underline;
    background: var(--indigo-soft);
}

.lc-extra-empty {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 4px;
}

.lc-charges-container:not(:empty) + .lc-extra-empty {
    display: none;
}

.lc-charge-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.lc-charge-row .lc-money-box {
    margin-top: 0;
}

.lc-icon-del-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
}

.lc-icon-del-btn:hover {
    color: var(--bad);
    background: var(--bad-soft);
}

/* --- Form Foot / Sticky Action Bar --- */
.lc-form-foot {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    position: sticky;
    bottom: 16px;
    z-index: 5;
}

.lc-submit-btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lc-submit-status {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    margin-top: 8px;
}

.lc-checkbox-label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-top: 12px;
    cursor: pointer;
    user-select: none;
}

.lc-checkbox-label input {
    margin-top: 3px;
    cursor: pointer;
}

/* --- Results Column --- */
.lc-results-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    min-height: 520px;
}

.lc-notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--warn-soft);
    border: 1px solid var(--warn-line);
    color: var(--warn);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.45;
}

.lc-notice.bad {
    background: var(--bad-soft);
    border-color: var(--bad-line);
    color: var(--bad);
}

.lc-notice:empty {
    display: none;
}

/* --- Empty State --- */
.lc-empty-state {
    text-align: center;
    padding: 56px 16px;
    color: var(--muted);
}

.lc-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--indigo-soft);
    color: var(--indigo);
    display: inline-grid;
    place-items: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.lc-empty-state h2 {
    font-family: var(--font-voice);
    color: var(--ink);
    font-size: 22px;
    margin: 0 0 8px 0;
}

.lc-empty-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 32px auto 0;
    max-width: 640px;
    text-align: left;
}

.lc-empty-step {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 12.5px;
    color: var(--muted);
}

.lc-empty-step b {
    display: block;
    color: var(--ink);
    margin-bottom: 4px;
    font-size: 13px;
}

@media (max-width: 700px) {
    .lc-empty-steps {
        grid-template-columns: 1fr;
    }
}

/* --- Loading State --- */
.lc-loading-state {
    padding: 90px 20px;
    text-align: center;
    color: var(--muted);
}

.lc-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--indigo-soft);
    border-top-color: var(--indigo);
    border-radius: 50%;
    animation: lcSpin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes lcSpin {
    to { transform: rotate(360deg); }
}

.lc-loading-state b {
    color: var(--ink);
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

/* --- Result Section Components --- */
.lc-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
}

.lc-result-context {
    font-size: 12.5px;
    color: var(--muted);
}

.lc-winner-card {
    background: linear-gradient(180deg, #F7FCF9, #E8F5EE);
    border: 1px solid var(--ok-line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 20px;
}

.lc-winner-card.none {
    background: var(--warn-soft);
    border-color: var(--warn-line);
}

.lc-winner-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ok);
}

.lc-winner-title {
    font-family: var(--font-voice);
    font-size: 24px;
    color: var(--ink);
    margin: 6px 0 4px 0;
}

/* --- Origin Cards Grid --- */
.lc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.lc-ocard {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    background: var(--card);
    transition: transform 0.15s, box-shadow 0.15s;
}

.lc-ocard.best {
    border: 2px solid var(--ok);
    background: linear-gradient(180deg, #FAFCFA, #F2F8F4);
    box-shadow: 0 10px 24px -14px rgba(27, 122, 76, 0.35);
}

.lc-ocard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.lc-ocard h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.lc-ocard .lc-total-price {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-code);
    letter-spacing: -0.02em;
    color: var(--ink);
}

.lc-ocard.best .lc-total-price {
    color: var(--ok);
}

.lc-ocard .lc-unit-price {
    font-size: 12.5px;
    font-family: var(--font-code);
    color: var(--muted);
    margin-top: 2px;
}

.lc-delta {
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lc-delta.low {
    color: var(--ok);
}

.lc-delta.up {
    color: var(--warn);
}

/* --- Badges & Chips --- */
.lc-chip {
    display: inline-block;
    white-space: nowrap;
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    background: var(--indigo-soft);
    color: var(--indigo);
}

.lc-chip.best {
    background: var(--ok-soft);
    color: var(--ok);
    border: 1px solid var(--ok-line);
}

.lc-chip.review {
    background: var(--warn-soft);
    color: var(--warn);
}

.lc-chip.error {
    background: var(--bad-soft);
    color: var(--bad);
}

.lc-duty-line {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line-soft);
}

.lc-duty-line.pref {
    color: var(--ok);
    font-weight: 600;
}

/* --- Comparison Tables --- */
.lc-table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}

.lc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lc-table th,
.lc-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-soft);
    text-align: right;
    white-space: nowrap;
}

.lc-table th:first-child,
.lc-table td:first-child {
    text-align: left;
    color: var(--ink-soft);
    font-weight: 500;
}

.lc-table thead th {
    background: var(--paper);
    color: var(--ink);
    font-weight: 600;
    border-bottom: 1px solid var(--line);
}

.lc-table tbody tr:last-child td {
    border-bottom: none;
}

.lc-table tr.total td,
.lc-table tr.total th {
    font-weight: 700;
    color: var(--ink);
    border-top: 2px solid var(--line);
    background: var(--paper-deep);
}

.lc-table .best-col {
    background: rgba(27, 122, 76, 0.05);
}

.lc-table td {
    font-family: var(--font-code);
}

.lc-table td:first-child {
    font-family: var(--font-ui);
}

/* --- Broker Checks Alert --- */
.lc-checks-box {
    border-left: 3px solid var(--warn);
    background: var(--warn-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.lc-checks-box h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--warn);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lc-checks-box ul {
    margin: 0;
    padding-left: 20px;
    font-size: 12.5px;
    color: var(--ink);
}

.lc-checks-box li {
    margin: 4px 0;
}

/* --- Expert Breakdown Details --- */
.lc-expert-details {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: 20px;
}

.lc-expert-details summary {
    cursor: pointer;
    color: var(--indigo);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.lc-expert-details summary:hover {
    text-decoration: underline;
}

.lc-expert-details[open] summary {
    margin-bottom: 12px;
}

.lc-expert-table {
    margin-top: 12px;
}

.lc-expert-table tr.group th {
    background: var(--paper-deep);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    color: var(--muted);
    padding: 7px 12px;
    text-align: left;
}

.lc-minor {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-ui);
    margin-top: 2px;
}

.lc-foot-hint {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 16px;
    font-style: italic;
}

.lc-stale-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--warn-soft);
    border: 1px solid var(--warn-line);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--warn);
}
