:root {
    --mollier-orange: #ee7601;
    --mollier-header-height: 3.5rem;
    --mollier-panel-bg: #f3f4f6;
    --mollier-card-bg: #ffffff;
    --mollier-border: #d1d5db;
    --mollier-text-muted: #6b7280;
}

body:has(.mollier-main) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

body:has(.mollier-main) footer {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mollier-main {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--mollier-header-height));
    margin-top: var(--mollier-header-height);
    min-height: 0;
    overflow: hidden;
}

.app-columns {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    --panel-left-pct: 50;
}

.panel-left {
    flex: 0 0 calc(var(--panel-left-pct) * 1%);
    min-width: 18rem;
    max-width: 75%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--mollier-panel-bg);
    border-right: 1px solid var(--mollier-border);
}

.panel-left-header {
    flex-shrink: 0;
    padding: 0.85rem 1rem 0.65rem;
    border-bottom: 1px solid var(--mollier-border);
    background: var(--mollier-card-bg);
}

.project-name-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.project-share-button {
    flex-shrink: 0;
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #e8e8e8;
    color: #333;
    cursor: pointer;
    line-height: 1.2;
}

.project-share-button:hover {
    background: #ddd;
}

.project-share-button:disabled {
    opacity: 0.65;
    cursor: default;
}

.project-name-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1.35rem;
    font-weight: 600;
    color: #111827;
    outline: none;
    padding: 0.15rem 0;
}

.project-name-input::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.panel-left-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.85rem 1rem 1.25rem;
}

.input-card {
    background: var(--mollier-card-bg);
    border: 1px solid var(--mollier-border);
    border-radius: 8px;
    padding: 0.85rem 0.9rem 0.95rem;
    margin-bottom: 0.85rem;
}

.input-card-title,
.process-card-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.input-grid {
    display: grid;
    gap: 0.65rem 0.75rem;
}

.input-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 520px) {
    .input-grid--2 {
        grid-template-columns: 1fr;
    }
}

.input-with-unit label,
.process-field label {
    display: block;
    font-size: 0.78rem;
    color: var(--mollier-text-muted);
    margin-bottom: 0.3rem;
}

.input-with-unit input,
.input-wrap input,
.process-field input,
.process-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    font-size: 0.92rem;
    background: #fff;
    color: #111827;
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.process-card {
    background: var(--mollier-card-bg);
    border: 1px solid var(--mollier-border);
    border-radius: 8px;
    padding: 0.85rem 0.9rem 0.95rem;
}

.process-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.process-card-head .process-card-title {
    margin: 0;
}

.btn-remove-step {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}

.btn-remove-step:hover {
    color: #dc2626;
    background: #fef2f2;
}

.process-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
}

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

.process-field[hidden],
.process-field.mode_field[hidden] {
    display: none;
}

.btn-add-process {
    width: 100%;
    margin-top: 0.35rem;
    border: none;
    border-radius: 8px;
    background: #16a34a;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1rem;
    cursor: pointer;
}

.btn-add-process:hover {
    background: #15803d;
}

.app-columns .resizer {
    flex: 0 0 6px;
    min-width: 6px;
    cursor: col-resize;
    background: #d1d5db;
    transition: background 0.15s ease;
}

.app-columns .resizer:hover,
.app-columns .resizer:active {
    background: var(--mollier-orange);
}

.panel-right {
    flex: 1 1 auto;
    min-width: 18rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
}

.chart-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--mollier-border);
    background: #fafafa;
}

.chart-toolbar-left,
.chart-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.chart-type-label {
    font-size: 0.82rem;
    color: var(--mollier-text-muted);
}

.chart-type-select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    background: #fff;
}

.toolbar-link {
    font-size: 0.82rem;
    color: #4b5563;
    text-decoration: none;
}

.toolbar-link:hover {
    color: var(--mollier-orange);
    text-decoration: underline;
}

.btn-report {
    border: none;
    border-radius: 6px;
    background: var(--mollier-orange);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    cursor: pointer;
}

.btn-report:hover {
    background: #d96800;
}

.chart-area {
    flex: 0 0 auto;
    min-height: 640px;
    height: min(104vh, 1040px);
    position: relative;
    background: #fff;
    overflow: hidden;
}

.chart-area svg {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-area .chart-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #b91c1c;
    text-align: center;
}

.chart-point-hit {
    cursor: pointer;
}

.chart-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 11rem;
    max-width: 16rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    pointer-events: none;
    font-size: 0.74rem;
    line-height: 1.35;
    color: #111827;
}

.chart-tooltip-title {
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #1a3d1a;
}

.chart-tooltip-table {
    width: 100%;
    border-collapse: collapse;
}

.chart-tooltip-table th {
    text-align: left;
    font-weight: 600;
    color: #4b5563;
    padding: 0.1rem 0.45rem 0.1rem 0;
    white-space: nowrap;
}

.chart-tooltip-table td {
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding: 0.1rem 0;
    white-space: nowrap;
}

.results-panel {
    flex-shrink: 0;
    padding: 0.65rem 0.75rem 0.9rem;
    border-top: 1px solid var(--mollier-border);
    background: #f8fafc;
}

.results-section {
    margin-bottom: 0.75rem;
}

.results-section-title {
    margin: 0 0 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e3a5f;
}

.results-table-wrap {
    overflow-x: auto;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
    white-space: nowrap;
}

.results-table thead th {
    background: #1e3a5f;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 0.42rem 0.55rem;
    border-right: 1px solid #2d4a73;
}

.results-table thead th:last-child {
    border-right: none;
}

.results-table tbody td {
    text-align: center;
    padding: 0.38rem 0.55rem;
    border-top: 1px solid #e5e7eb;
    border-right: 1px solid #f1f5f9;
    color: #111827;
}

.results-table tbody tr:nth-child(even) td {
    background: #f9fafb;
}

.results-table tbody td:first-child {
    font-weight: 600;
    color: #1e3a5f;
}

.results-table tbody td:last-child {
    border-right: none;
}

.results-note {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    color: #6b7280;
}
