.railway-status-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
}

.checklist-project-heading {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.checklist-project-number {
    overflow: hidden;
    color: #5f6368;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-title-row .checklist-project-heading .title-medium {
    width: 100%;
    flex: none;
}

.railway-project-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid #a8c7fa;
    border-radius: 999px;
    background: #e8f0fe;
    color: #174ea6;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    box-sizing: border-box;
}

.railway-mode-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 12px;
    width: min(100%, 1160px);
    padding: 10px 14px;
    border: 1px solid #a8c7fa;
    border-radius: 12px;
    background: #e8f0fe;
    color: #174ea6;
    font-size: 13px;
    font-weight: 800;
    box-sizing: border-box;
}

.railway-facility-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #e8f0fe;
    color: #174ea6;
    font-size: 10px;
    font-weight: 800;
}

.railway-facility-age-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    margin-left: 6px;
    padding: 2px 7px;
    border: 1px solid #c6cbd4;
    border-radius: 6px;
    background: #fff;
    color: #3c4043;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    box-sizing: border-box;
}

.railway-facility-age-toggle input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #0b57d0;
    cursor: pointer;
}

.railway-age-selected {
    background-color: #d9d9d9 !important;
}

.railway-age-unselected {
    background-color: #fff !important;
}

#railway-assessment-host {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: block;
    background: #f5f7fa;
    font-family: "Pretendard", "Inter Var", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.railway-assessment-open {
    overflow: hidden !important;
}

@media (max-width: 599px) {
    .railway-project-badge {
        padding: 3px 6px;
        font-size: 10px;
    }
}

/* The rules below are also injected into the assessment shadow root. */
:host {
    --railway-blue: #1976d2;
    --railway-blue-dark: #1565c0;
    --railway-ink: #1f2937;
    --railway-muted: #64748b;
    --railway-line: #e2e8f0;
    --railway-panel: #ffffff;
    --railway-font-family: "Pretendard", "Inter Var", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: block;
    height: 100%;
    color: var(--railway-ink);
    font-family: var(--railway-font-family);
}

:host * {
    box-sizing: border-box;
    font-family: var(--railway-font-family) !important;
}

:host button,
:host input,
:host select,
:host textarea {
    font: inherit;
}

:host button {
    cursor: pointer;
}

.railway-ui-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.railway-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    min-height: 0;
    background: #f5f7fa;
}

.railway-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 10px 18px;
    border-bottom: 1px solid #e3e3e3;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

.railway-back,
.railway-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #d4dbe6;
    border-radius: 12px;
    background: #fff;
    color: #26384d;
    font-size: 21px;
}

.railway-back:hover,
.railway-icon-button:hover {
    background: #f2f6fb;
}

.railway-heading {
    min-width: 0;
    flex: 1;
}

.railway-heading h1 {
    margin: 0;
    font-size: 19px;
    line-height: 1.35;
}

.railway-heading p {
    overflow: hidden;
    margin: 3px 0 0;
    color: var(--railway-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.railway-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.railway-save-state {
    min-width: 66px;
    color: #526273;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}

.railway-primary,
.railway-secondary,
.railway-danger,
.railway-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
}

.railway-primary {
    border: 1px solid var(--railway-blue);
    background: var(--railway-blue);
    color: #fff;
}

.railway-primary:hover {
    background: var(--railway-blue-dark);
}

.railway-secondary {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
}

.railway-danger {
    border: 1px solid #f2b8b5;
    background: #fce8e6;
    color: #b3261e;
}

.railway-ghost {
    border: 1px solid #d4dbe6;
    background: #fff;
    color: #405064;
}

.railway-workspace {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 0;
}

.railway-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px;
    border-right: 1px solid #cfd7e3;
    background: #f8fafc;
}

.railway-progress {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #d8e0ea;
    border-radius: 12px;
    background: #fff;
}

.railway-progress-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: #405064;
    font-size: 12px;
    font-weight: 800;
}

.railway-progress-track {
    overflow: hidden;
    height: 7px;
    border-radius: 999px;
    background: #e7ebf1;
}

.railway-progress-value {
    height: 100%;
    border-radius: inherit;
    background: var(--railway-blue);
    transition: width .2s ease;
}

.railway-filter {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.railway-filter input,
.railway-filter select {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #cfd7e3;
    border-radius: 9px;
    background: #fff;
    color: #26384d;
    font-size: 12px;
    outline: none;
}

.railway-filter input:focus,
.railway-filter select:focus {
    border-color: var(--railway-blue);
    box-shadow: 0 0 0 2px rgba(11, 87, 208, .12);
}

.railway-item-list {
    overflow-y: auto;
    min-height: 0;
    padding-right: 3px;
}

.railway-item-button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 5px;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #3b4b5e;
    text-align: left;
}

.railway-item-button:hover {
    background: #eef3fa;
}

.railway-item-button.active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1976d2;
}

.railway-item-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: #e5eaf1;
    font-size: 10px;
    font-weight: 900;
}

.railway-item-button.active .railway-item-number {
    background: var(--railway-blue);
    color: #fff;
}

.railway-item-label {
    overflow: hidden;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.railway-item-page {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 5px;
    border-radius: 5px;
    background: #eef2f7;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.railway-item-button.active .railway-item-page {
    background: #dbeafe;
    color: #1d4ed8;
}

.railway-item-complete {
    display: inline-flex;
    color: #1976d2;
    font-size: 13px;
}

.railway-item-complete .railway-ui-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.4;
}

.railway-main {
    overflow-y: auto;
    min-width: 0;
    padding: 20px;
}

.railway-form {
    width: min(100%, 980px);
    margin: 0 auto;
}

.railway-form-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.railway-form-heading h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

.railway-form-heading p {
    margin: 4px 0 0;
    color: var(--railway-muted);
    font-size: 12px;
}

.railway-form-heading-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.railway-master-preview-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
}

.railway-master-preview-button:hover,
.railway-master-preview-button:focus-visible {
    border-color: #2563eb;
    background: #dbeafe;
}

.railway-master-section-label {
    margin: 0 0 4mm;
    padding: 2mm 3mm;
    border-left: 1.2mm solid #2563eb;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 9pt;
    font-weight: 800;
}

.railway-primary:disabled,
.railway-secondary:disabled {
    cursor: wait;
    opacity: .62;
}

.railway-master-dialog {
    position: fixed;
    inset: 0;
    z-index: 2147483400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(3px);
}

.railway-master-dialog[hidden] {
    display: none !important;
}

.railway-master-dialog-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(100%, 980px);
    height: min(94vh, 1040px);
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #e5e7eb;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .42);
}

.railway-master-dialog-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    border-bottom: 1px solid #cbd5e1;
    background: #fff;
}

.railway-master-dialog-card > header strong,
.railway-master-dialog-card > header span {
    display: block;
}

.railway-master-dialog-card > header strong {
    font-size: 14px;
}

.railway-master-page-label {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.railway-master-dialog-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.railway-master-dialog-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #334155;
}

.railway-master-dialog-actions button:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.railway-master-dialog-actions button:disabled {
    cursor: default;
    opacity: .35;
}

.railway-master-preview-body {
    overflow: auto;
    min-height: 0;
    padding: 18px;
    text-align: center;
    -webkit-overflow-scrolling: touch;
}

.railway-master-preview-body > svg {
    display: block;
    width: min(100%, 210mm);
    height: auto;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 3px 18px rgba(15, 23, 42, .18);
}

.railway-master-loading,
.railway-master-error {
    display: grid;
    min-height: 240px;
    place-items: center;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.railway-master-error {
    color: #b91c1c;
}

.railway-category-chip {
    flex: none;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1976d2;
    font-size: 11px;
    font-weight: 900;
}

.railway-category-chips {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.railway-detail-category-chip {
    background: #e6f4ea;
    color: #137333;
}

.railway-table-card,
.railway-panel-card {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #d5dce7;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(41, 62, 89, .06);
}

.railway-source-scroll {
    overflow-x: auto;
    padding: 4px 2px 10px;
}

.railway-source-scroll > table {
    margin: 0 auto;
}

.railway-source-scroll input,
.railway-source-scroll textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #97a8bd;
    border-radius: 4px;
    background: #fffef3;
    color: #15263b;
    outline: none;
}

.railway-source-scroll input {
    min-height: 30px;
    padding: 4px 6px;
    text-align: center;
}

.railway-source-scroll .railway-calculated-input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid #97a8bd;
    border-radius: 4px;
    background: #eef5ff;
    color: #174ea6;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    cursor: default;
}

.railway-source-scroll textarea {
    min-height: 74px;
    padding: 7px;
    line-height: 1.55;
    resize: vertical;
}

.railway-source-scroll input:focus,
.railway-source-scroll textarea:focus {
    border-color: var(--railway-blue);
    box-shadow: 0 0 0 2px rgba(11, 87, 208, .14);
}

.railway-score-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.railway-score-wrap input {
    max-width: 110px;
}

.railway-score-wrap span {
    color: #405064;
    font-weight: 800;
}

.railway-summary-tools {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.railway-summary-regenerate {
    padding: 5px 8px;
    border: 1px solid #a8c7fa;
    border-radius: 6px;
    background: #e8f0fe;
    color: #174ea6;
    font-size: 10px;
    font-weight: 800;
}

.railway-photo-slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-height: 115px;
    padding: 6px;
}

.railway-photo-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 8px;
    border: 1px dashed #9eb0c5;
    border-radius: 8px;
    background: #f8fafc;
}

.railway-photo-slot-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #405064;
    font-size: 10px;
    font-weight: 900;
}

.railway-photo-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid #a8c7fa;
    border-radius: 6px;
    background: #e8f0fe;
    color: #174ea6;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.railway-photo-add input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

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

.railway-photo-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    background: #e5eaf1;
}

.railway-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.railway-photo-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .78);
    color: #fff;
    font-size: 13px;
}

.railway-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.railway-panel-title h3 {
    margin: 0;
    font-size: 15px;
}

.railway-panel-title p {
    margin: 3px 0 0;
    color: var(--railway-muted);
    font-size: 11px;
}

.railway-measurement-card {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e7ee;
}

.railway-measurement-card:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.railway-formula-note {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-left: 3px solid #f9ab00;
    background: #fff8e1;
    color: #6f4b00;
    font-size: 11px;
    line-height: 1.55;
}

.railway-derived-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    width: 100%;
    padding: 4px 6px;
    border-radius: 4px;
    background: #e6f4ea;
    color: #137333;
    font-weight: 900;
}

.railway-calc-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.railway-calc-table th,
.railway-calc-table td {
    padding: 7px;
    border: 1px solid #d6dde7;
    font-size: 11px;
    text-align: center;
}

.railway-calc-table th {
    background: #f2f5f9;
    color: #405064;
    font-weight: 900;
}

.railway-calc-table input,
.railway-calc-table select {
    width: 100%;
    min-height: 34px;
    padding: 5px 7px;
    border: 1px solid #bdc8d5;
    border-radius: 6px;
    background: #fff;
}

.railway-calc-result {
    color: #137333;
    font-weight: 900;
}

.railway-calc-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.railway-empty {
    padding: 30px 12px;
    color: #6a7786;
    text-align: center;
    font-size: 13px;
}

.railway-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 8;
    max-width: 360px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #172033;
    color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    font-size: 12px;
    font-weight: 700;
}

.railway-capture-dock {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    width: min(330px, calc(100vw - 36px));
    pointer-events: none;
}

.railway-capture-dock.collapsed {
    width: auto;
}

.railway-capture-dock.collapsed .railway-capture-panel,
.railway-capture-dock.collapsed .railway-photo-slot-toolbar,
.railway-capture-dock.collapsed .railway-camera-fab,
.railway-capture-dock.collapsed .railway-gallery-fab {
    display: none !important;
}

.railway-photo-slot-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 9px;
    border: 2px solid #2563eb;
    border-radius: 10px;
    background: rgba(239, 246, 255, .98);
    box-shadow: 0 10px 28px rgba(30, 64, 175, .22);
    pointer-events: auto;
}

.railway-photo-slot-toolbar[hidden] {
    display: none !important;
}

.railway-photo-slot-toolbar-label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    color: #475569;
    font-size: 9px;
    font-weight: 800;
}

.railway-photo-slot-target {
    overflow: hidden;
    color: #1d4ed8;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.railway-photo-slot-toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
}

.railway-capture-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(42vh, 360px);
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 12px 36px rgba(15, 23, 42, .24);
    pointer-events: auto;
}

.railway-capture-panel[hidden],
.railway-camera-count[hidden],
.railway-camera-input,
.railway-gallery-input {
    display: none !important;
}

.railway-capture-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 12px;
}

.railway-capture-heading > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.railway-capture-target {
    overflow: hidden;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.railway-capture-target[hidden] {
    display: none !important;
}

.railway-capture-total {
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.railway-capture-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    list-style: none;
    overscroll-behavior: contain;
}

.railway-capture-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px 30px;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.railway-capture-entry.has-target {
    grid-template-columns: minmax(0, 1fr) auto 22px 30px;
}

.railway-capture-empty {
    padding: 12px 10px;
    border: 1px dashed #93c5fd;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.railway-capture-entry.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.railway-capture-preview {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: inherit;
    text-align: left;
}

.railway-capture-preview img {
    width: 52px;
    height: 42px;
    border-radius: 6px;
    background: #e2e8f0;
    object-fit: cover;
}

.railway-capture-check {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

.railway-capture-check:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.railway-capture-description {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    color: #1e293b;
    font-size: 11px;
}

.railway-capture-description small {
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.railway-capture-actions {
    padding: 8px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.railway-capture-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #1976d2;
    border-radius: 7px;
    background: #1976d2;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.railway-capture-download:disabled {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
}

.railway-capture-apply {
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.railway-capture-apply[hidden] {
    display: none !important;
}

.railway-capture-remove {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 18px;
    font-weight: 900;
    line-height: 28px;
}

.railway-capture-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    pointer-events: auto;
}

.railway-capture-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #94a3b8;
    border-radius: 50%;
    background: #fff;
    color: #334155;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .2);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.railway-capture-toggle:hover,
.railway-capture-toggle:focus-visible {
    border-color: #1976d2;
    color: #1976d2;
}

.railway-camera-fab,
.railway-gallery-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 50px;
    padding: 10px 17px;
    border: 1px solid #1976d2;
    border-radius: 999px;
    background: #1976d2;
    color: #fff;
    box-shadow: 0 10px 28px rgba(25, 118, 210, .28);
    font-size: 13px;
    font-weight: 900;
    pointer-events: auto;
}

.railway-camera-fab:hover,
.railway-camera-fab:focus-visible {
    background: #1565c0;
}

.railway-gallery-fab {
    min-height: 46px;
    padding: 9px 14px;
    border-color: #bfdbfe;
    background: #fff;
    color: #1976d2;
    box-shadow: 0 8px 22px rgba(25, 118, 210, .16);
}

.railway-gallery-fab:hover,
.railway-gallery-fab:focus-visible {
    border-color: #1976d2;
    background: #eff6ff;
}

:host([data-runtime="native"]) .railway-camera-fab,
:host([data-runtime="native"]) .railway-gallery-fab {
    min-height: 42px;
    gap: 5px;
    padding: 7px 12px;
    font-size: 12px;
}

:host([data-runtime="native"]) .railway-camera-fab .railway-ui-icon,
:host([data-runtime="native"]) .railway-gallery-fab .railway-ui-icon {
    width: 16px;
    height: 16px;
}

:host([data-runtime="native"]) .railway-camera-count {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 9px;
}

@media (max-width: 620px) {
    :host([data-runtime="native"]) .railway-camera-fab,
    :host([data-runtime="native"]) .railway-gallery-fab {
        min-height: 40px;
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (orientation: landscape) and (max-height: 620px) {
    :host([data-runtime="native"]) .railway-camera-fab,
    :host([data-runtime="native"]) .railway-gallery-fab {
        min-height: 38px;
        padding: 5px 9px;
        font-size: 10px;
    }

    :host([data-runtime="native"]) .railway-camera-fab .railway-ui-icon,
    :host([data-runtime="native"]) .railway-gallery-fab .railway-ui-icon {
        width: 15px;
        height: 15px;
    }
}

.railway-camera-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff;
    color: #1976d2;
    font-size: 10px;
    line-height: 1;
}

.railway-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #405064;
    font-size: 14px;
    font-weight: 800;
}

@media (max-width: 860px) {
    .railway-workspace {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .railway-sidebar {
        min-width: 0;
        max-width: 100%;
        max-height: 178px;
        border-right: 0;
        border-bottom: 1px solid #cfd7e3;
    }

    .railway-progress {
        display: none;
    }

    .railway-filter {
        grid-template-columns: minmax(0, 1fr) repeat(2, minmax(112px, 150px));
    }

    .railway-item-list {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .railway-item-button {
        flex: 0 0 190px;
        margin: 0;
    }

    .railway-main {
        width: 100%;
        max-width: 100%;
        padding: 12px;
    }
}

@media (max-width: 620px) {
    .railway-header {
        min-height: 62px;
        padding: 8px 10px;
    }

    .railway-heading h1 {
        font-size: 16px;
    }

    .railway-heading p,
    .railway-save-state {
        display: none;
    }

    .railway-header-actions .railway-secondary span,
    .railway-header-actions .railway-primary span {
        display: none;
    }

    .railway-header-actions .railway-secondary,
    .railway-header-actions .railway-primary {
        width: 42px;
        padding: 7px;
    }

    .railway-sidebar {
        max-height: 158px;
        padding: 9px;
    }

    .railway-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .railway-filter .railway-search {
        grid-column: 1 / -1;
    }

    .railway-table-card,
    .railway-panel-card {
        padding: 10px;
        border-radius: 10px;
    }

    .railway-photo-slots {
        grid-template-columns: 1fr;
    }

    .railway-calc-table {
        min-width: 680px;
    }

    .railway-calc-scroll {
        overflow-x: auto;
    }

    .railway-capture-dock {
        right: 12px;
        bottom: 12px;
        width: min(310px, calc(100vw - 24px));
    }

    .railway-camera-fab,
    .railway-gallery-fab {
        min-height: 46px;
        padding: 8px 14px;
    }

    .railway-form-heading-actions {
        gap: 4px;
    }

    .railway-master-preview-button {
        width: 36px;
        min-height: 34px;
        padding: 6px;
    }

    .railway-master-preview-button span {
        display: none;
    }

    .railway-master-dialog {
        padding: 0;
    }

    .railway-master-dialog-card {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    .railway-master-preview-body {
        padding: 6px;
    }
}

@media (max-width: 860px) and (orientation: portrait) {
    .railway-sidebar {
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .railway-filter {
        flex: 0 0 auto;
    }

    .railway-item-list {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 0 6px;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
    }

    .railway-item-button {
        flex: 0 0 190px;
        width: 190px;
        margin: 0;
    }
}

@media print {
    .railway-header,
    .railway-sidebar,
    .railway-form-heading,
    .railway-capture-dock,
    .railway-panel-card {
        display: none !important;
    }

    .railway-shell,
    .railway-workspace {
        display: block;
        height: auto;
    }

    .railway-main {
        overflow: visible;
        padding: 0;
    }
}

/* Attached HTML reference: A4 two-page inspection document layout. */
.railway-shell {
    background: #f5f7fa;
}

.railway-header {
    min-height: 64px;
    padding: 10px 20px;
    border-bottom: 1px solid #e3e3e3;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

.railway-back,
.railway-header .railway-secondary,
.railway-header .railway-primary {
    min-height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
}

.railway-back {
    width: 40px;
    height: 40px;
    background: #fff;
}

.railway-back:hover {
    background: #f1f3f4;
}

.railway-header .railway-secondary {
    background: #fff;
    color: #334155;
}

.railway-header .railway-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.railway-header .railway-primary {
    border-color: #1976d2;
    background: #1976d2;
    color: #fff;
}

.railway-header .railway-primary:hover {
    background: #1565c0;
}

.railway-heading h1 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
}

.railway-heading p {
    margin-top: 2px;
    color: #cbd5e1;
    font-size: 11px;
}

.railway-heading small {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.railway-save-state {
    color: #64748b;
}

.railway-workspace {
    grid-template-columns: 270px minmax(0, 1fr);
}

.railway-sidebar {
    background: #f8fafc;
}

.railway-main {
    overflow: auto;
    padding: 18px;
    background: #f5f7fa;
}

.railway-form {
    width: max-content;
    min-width: 100%;
    margin: 0;
}

.railway-form-heading {
    width: 210mm;
    margin: 0 auto 10px;
    padding: 8px 12px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 5px rgba(15, 23, 42, .08);
}

.railway-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 18px;
    padding: 18mm 22mm 17mm;
    background: #fff;
    box-shadow: 0 2px 14px rgba(15, 23, 42, .16);
}

.railway-document-width {
    margin: 0 auto;
}

.railway-chapter,
.railway-subchapter {
    color: #111;
    font-family: "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
    font-weight: 700;
}

.railway-chapter {
    margin: 0 0 8mm 3mm;
    font-size: 11pt;
}

.railway-subchapter {
    margin: 0 0 11mm 6mm;
    font-size: 10.5pt;
}

.railway-source-scroll {
    overflow: visible;
    padding: 0;
}

.railway-source-scroll > table {
    margin: 0 auto;
    color: #111;
    background: #fff;
}

.railway-source-scroll input,
.railway-source-scroll textarea {
    border: 1px solid #94a3b8;
    border-radius: 2px;
    background: #fff;
    color: #111;
}

.railway-source-scroll input:focus,
.railway-source-scroll textarea:focus {
    border-color: #2563eb;
    outline: 2px solid #93c5fd;
    box-shadow: none;
}

.railway-source-scroll textarea.railway-summary {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: .5mm;
    line-height: 1.15;
    overflow-y: hidden;
    resize: none;
    white-space: pre-wrap;
}

.railway-score-wrap {
    flex-wrap: nowrap;
    gap: 2mm;
}

.railway-score-wrap input.railway-score {
    width: 18mm;
    min-height: 0;
    height: 6mm;
    padding: .5mm 1mm;
    font-size: 9pt;
    font-weight: 700;
}

.railway-score-mode {
    display: inline-flex;
    align-items: center;
    gap: 1mm;
    color: #111;
    font-size: 8pt;
    font-weight: 700;
    white-space: nowrap;
}

.railway-score-mode input[type="radio"] {
    width: 3.5mm;
    height: 3.5mm;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.railway-inspection-photo-cell {
    position: relative;
    overflow: hidden;
}

.railway-inspection-photo-cell > .railway-single-photo-slot {
    height: 100%;
    min-height: 0;
}

.railway-single-photo-slot {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px dashed #8b95a7;
    background: #f8fafc;
    cursor: pointer;
}

.railway-single-photo-slot:hover {
    border-color: #60a5fa;
    background: #eff6ff;
}

.railway-single-photo-slot.is-selected {
    border: 2px solid #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}

.railway-inspection-photo-cell.is-photo-target,
.railway-measurement-photo-cell.is-photo-target {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #eff6ff !important;
}

.railway-single-photo-slot.small {
    min-height: 24.5mm;
}

.railway-single-photo-slot.dragover {
    outline: 2px solid #2563eb;
    background: #eff6ff;
}

.railway-single-photo-slot.has-photo {
    border-style: solid;
    background: #fff;
}

.railway-single-photo-slot img {
    display: none;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
}

.railway-single-photo-slot.has-photo img {
    display: block;
}

.railway-single-photo-slot.has-photo .railway-upload-guide {
    display: none;
}

.railway-upload-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5mm;
    padding: 4mm 2mm;
    color: #64748b;
    font-size: 8.5pt;
    line-height: 1.5;
    text-align: center;
}

.railway-upload-guide .railway-ui-icon {
    width: 24px;
    height: 24px;
    color: #1976d2;
}

.railway-upload-guide strong {
    display: block;
    color: #334155;
}

.railway-single-photo-slot .railway-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.railway-single-photo-slot .railway-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .76);
    color: #fff;
    font-weight: 700;
    line-height: 24px;
}

.railway-photo-candidate-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #2563eb;
    border-radius: 7px;
    background: #fff;
    color: #1e40af;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

.railway-photo-candidate-add .railway-ui-icon {
    width: 14px;
    height: 14px;
}

.railway-photo-candidate-add:disabled {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.railway-photo-candidate-add:focus-visible,
.railway-capture-apply:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.railway-single-photo-slot .railway-photo-remove .railway-ui-icon,
.railway-capture-remove .railway-ui-icon {
    width: 15px;
    height: 15px;
    vertical-align: middle;
}

.railway-single-photo-slot.has-photo .railway-photo-remove {
    display: block;
}

.railway-detail-photo-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: #111;
    background: #fff;
}

.railway-detail-photo-table th,
.railway-detail-photo-table td {
    border: .7px solid #222;
    vertical-align: middle;
}

.railway-detail-photo-cell {
    height: 27.5mm;
    padding: 1.5mm;
}

.railway-caption-row th,
.railway-caption-row td {
    height: 7.5mm;
    padding: .7mm;
    font-size: 8.5pt;
    text-align: center;
}

.railway-caption-input {
    width: 100%;
    padding: 1mm;
    border: 1px solid #94a3b8;
    border-radius: 2px;
    background: #fff;
    color: #111;
    text-align: center;
}

.railway-caption-input:focus {
    border-color: #2563eb;
    outline: 2px solid #93c5fd;
}

.railway-measurements {
    margin-top: 7mm;
}

.railway-measurement-card {
    margin-top: 7mm;
    padding: 0;
    border-top: 0;
}

.railway-measurement-card:first-child {
    margin-top: 0;
}

.railway-measurement-card[data-mode="motorCurrentPhoto"] {
    margin-top: 3mm;
}

.railway-motor-current-phase {
    display: grid;
    grid-template-columns: 3mm minmax(0, 1fr) 3mm;
    align-items: center;
    gap: .4mm;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.railway-motor-current-phase > span {
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
}

.railway-measurement-card .railway-source-scroll input {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: .5mm 1mm;
    line-height: 1.15;
}

.railway-measurement-card .railway-source-scroll .railway-motor-current-input {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 6mm;
    min-height: 6mm;
    padding: .2mm .5mm;
    font-size: 10px;
}

.railway-duct-original-form {
    width: 100%;
    padding: 1mm 1.5mm;
    text-align: left;
}

.railway-duct-original-form p {
    margin: 0 0 .8mm;
    color: #111;
    font-size: 8.5pt;
    line-height: 1.35;
}

.railway-duct-heading,
.railway-duct-subheading {
    font-weight: 700;
}

.railway-duct-fields {
    display: grid;
    gap: .8mm;
}

.railway-duct-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2mm;
    color: #111;
    font-size: 8.5pt;
    line-height: 1.35;
}

.railway-duct-value {
    display: inline-flex;
    flex: 0 0 42mm;
    align-items: center;
    gap: 1mm;
}

.railway-duct-value .railway-duct-input {
    width: 30mm;
    height: 6mm;
    min-height: 6mm;
}

.railway-duct-value em {
    font-style: normal;
    white-space: nowrap;
}

.railway-duct-result {
    display: grid;
    gap: 1mm;
    margin-top: 1mm;
    color: #334155;
    font-size: 8pt;
    font-weight: 700;
}

.railway-duct-original-form .railway-calculated-input {
    min-height: 12mm;
    font-size: 8pt;
    line-height: 1.35;
    text-align: left;
}

.railway-airflow-sample-input {
    height: 6.2mm !important;
    min-height: 6.2mm !important;
    padding: .2mm .4mm !important;
    font-size: 8pt;
}

.railway-measurement-photo-cell {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
}

.railway-measurement-photo-cell > .railway-single-photo-slot {
    height: 100%;
    min-height: 24.5mm;
}

.railway-derived-value {
    min-height: 28px;
    padding: 1.8mm;
    border-radius: 0;
    background: transparent;
    color: #111;
    font-size: 8.5pt;
    line-height: 1.35;
}

.railway-formula-note {
    margin-top: 5mm;
    padding: 3mm 4mm;
    border: 1px solid #cbd5e1;
    border-left: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 8.3pt;
}

.railway-formula-note strong {
    color: #1e293b;
}

.railway-calculator-panel {
    margin-top: 7mm;
    padding-top: 5mm;
    border-top: 1px solid #cbd5e1;
}

.railway-calculator-panel .railway-panel-title {
    margin-bottom: 3mm;
}

@media (max-width: 860px) {
    .railway-workspace {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .railway-main {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0;
    }

    .railway-form-heading {
        margin: 8px 0;
    }

    .railway-page {
        margin: 0 0 18px;
        box-shadow: none;
    }
}

@media (max-width: 860px) and (orientation: portrait) {
    .railway-header {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .railway-heading,
    .railway-heading h1,
    .railway-heading small {
        min-width: 0;
        max-width: 100%;
    }

    .railway-heading h1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .railway-header-actions {
        flex: 0 0 auto;
        gap: 4px;
    }

    .railway-sidebar,
    .railway-filter,
    .railway-item-list {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .railway-main {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .railway-form {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .railway-form-heading {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 8px 0;
    }

    .railway-form-heading > div:first-child {
        min-width: 0;
    }

    .railway-form-heading h2 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .railway-page {
        zoom: var(--railway-mobile-page-scale, .5);
        margin-right: auto;
        margin-left: auto;
    }
}

@media print {
    .railway-header,
    .railway-sidebar,
    .railway-form-heading,
    .railway-summary-tools,
    .railway-calc-actions,
    .railway-formula-note {
        display: none !important;
    }

    .railway-photo-slot-toolbar {
        display: none !important;
    }

    .railway-page {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        box-shadow: none;
        break-after: page;
        page-break-after: always;
    }

    .railway-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    .railway-single-photo-slot {
        border: 0;
        background: #fff;
    }

    .railway-single-photo-slot:not(.has-photo) .railway-upload-guide {
        color: transparent;
    }
}
