/* Base reset */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    background-color: #ffffff;
    color: #111111;
}

#lr-travtools-ct-shipbuild {
    background-color: #e6ebf0;
    font-family: Arial, Helvetica, sans-serif;
    color: #111111;
    padding: 0.5em;
    min-width: 960px;
}

/* Clear floats after the two-column layout */
#lr-travtools-ct-shipbuild::after {
    content: '';
    display: table;
    clear: both;
}

.error-text {
    color: #be2218;
    margin: 0.2em 0;
}

/* Left column */
#lr-travtools-ct-shipbuild .lrctshipbuild-left {
    width: 48%;
    float: left;
    padding: 0.5em;
}

/* Right column - ship sheet */
#lr-travtools-ct-shipbuild .lrctshipbuild-shipsheet {
    width: 47%;
    float: right;
    padding: 0.6em 0.6em 0.6em 1.5em;
    border-left: 1px solid black;
}

/* Footer */
#lr-travtools-ct-shipbuild .lrctshipbuild-footer {
    clear: both;
    width: 100%;
    padding: 5px;
    border-top: 1px solid black;
    margin-top: 1em;
}

/* Headings */
#lr-travtools-ct-shipbuild h1,
#lr-travtools-ct-shipbuild h2,
#lr-travtools-ct-shipbuild h3 {
    color: #be2218;
    margin: 0.4em 0;
}

#lr-travtools-ct-shipbuild h1 {
    font-size: 1.4em;
}

#lr-travtools-ct-shipbuild h2 {
    font-size: 1.1em;
}

#lr-travtools-ct-shipbuild h3 {
    font-size: 1em;
}

/* Links */
#lr-travtools-ct-shipbuild a:link,
#lr-travtools-ct-shipbuild a:visited {
    color: #be2218;
}

#lr-travtools-ct-shipbuild a:hover {
    color: #555555;
}

/* Tables */
#lr-travtools-ct-shipbuild table,
#lr-travtools-ct-shipbuild th,
#lr-travtools-ct-shipbuild td,
#lr-travtools-ct-shipbuild tr {
    border: 1px solid;
    border-collapse: collapse;
    text-align: left;
    padding: 0.3em;
}

#lr-travtools-ct-shipbuild table.lrctshipbuild-shiptable {
    width: 95%;
}

#lr-travtools-ct-shipbuild th {
    color: #cfcfcf;
    border-color: white;
    background-color: #222222;
    font-weight: bold;
}

#lr-travtools-ct-shipbuild td.sectionLabel {
    color: #cfcfcf;
    border-color: white;
    background-color: #222222;
    font-weight: bold;
}

#lr-travtools-ct-shipbuild table div.celllabel {
    color: #111111;
    font-size: 0.8em;
}

/* Input layout rows */
.lrctshipbuild-textline {
    margin: 0.4em 0;
}

.lrctshipbuild-textline label {
    display: inline-block;
    min-width: 140px;
    font-weight: bold;
}

.lrctshipbuild-textline input[type="text"],
.lrctshipbuild-textline select {
    max-width: 100%;
}

.lrctshipbuild-textline textarea {
    display: block;
    margin-top: 0.3em;
    width: 100%;
}

/* Buttons */
#lr-travtools-ct-shipbuild button {
    border-radius: 4px;
    border: 1px solid #999;
    padding: 0.2em 0.7em;
    font-size: 0.9em;
    font-family: inherit;
    background-color: #d8dde2;
    cursor: pointer;
    margin: 0 0.1em;
}

#lr-travtools-ct-shipbuild button:hover {
    background-color: #c0c8d0;
    border-color: #be2218;
}

/* Nested turret / weapon layout */
#turretlist table,
#vehicleList table,
#craftList table {
    width: 100%;
    margin-top: 0.4em;
}

/* Sheet cell labels */
.celllabel {
    color: #555;
    font-size: 0.8em;
}

/* Hull picker section */
#hullTypePicker {
    margin-bottom: 0.5em;
}

#hullTypePicker input[type="radio"] {
    margin-left: 0;
    margin-right: 0.3em;
}

/* Section separators */
#lr-travtools-ct-shipbuild hr {
    border: none;
    border-top: 1px solid #999;
    margin: 0.8em 0;
}

/* Paragraph margins in ship sheet */
#lr-travtools-ct-shipbuild .lrctshipbuild-shipsheet p {
    margin: 0.1em 0;
}

/* Print: show only the ship card */
@media print {
    .lrctshipbuild-left {
        display: none !important;
    }
    #lr-travtools-ct-shipbuild,
    .lrctshipbuild-shipsheet {
        float: none !important;
        width: 100% !important;
        min-width: 0 !important;
        background: none !important;
        padding: 0 !important;
    }

    /* Prevent individual rows from splitting mid-row */
    .lrctshipbuild-shiptable tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Keep section label glued to the first row of its section */
    .lrctshipbuild-shiptable td.sectionLabel {
        break-after: avoid;
        page-break-after: avoid;
    }

    /* Keep inner tables (hardpoints, vehicles, craft) from breaking */
    #sheet-hardpoints-table,
    #sheet-vehicles-table,
    #sheet-craft-table {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Rules clarification note below input form */
.lrctshipbuild-rules-note {
    margin-top: 1em;
    padding: 0.6em 0.8em;
    background-color: #dde3ea;
    border-left: 3px solid #7a8fa6;
    font-size: 0.9em;
    color: #333;
}
.lrctshipbuild-rules-note p {
    margin: 0.3em 0;
}
.lrctshipbuild-rules-note p:first-child {
    margin-top: 0;
}
.lrctshipbuild-rules-note p:last-child {
    margin-bottom: 0;
}

/* Sheet inner tables */
#sheet-hardpoints-table,
#sheet-vehicles-table,
#sheet-craft-table {
    width: 100%;
    margin-top: 0.3em;
}
