body {
    font-family: monospace;
    background-color: #e6e6e6;
    color: #000;
    line-height: 1.4;
    padding: 10px;
    font-size: 13px;
}

.container {
    width: 1100px;
    margin: auto;
    background: #c0d9a9;
    border: 2px solid #555;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 1.2em;
    text-align: center;
    color: #000;
    margin: 5px 0;
    padding: 0;
}

.top-selectors-row {
    display: flex;
    justify-content: flex-start;
    padding: 5px 10px;
    background-color: #aed6a1;
    border-bottom: 1px solid #777;
    font-weight: bold;
}

.modal-buttons-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    background-color: #e8f4e8;
    border: 1px solid #aaa;
    border-radius: 5px;
    padding: 8px;
    margin: 10px 0;
}

.modal-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #888;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    font-family: inherit;
}

.modal-btn:hover {
    background-color: #f0f8ff;
    border-color: #0066cc;
    transform: translateY(-1px);
}

.modal-btn span:first-child {
    font-size: 16px;
}

.modal-btn span:last-child {
    font-size: 11px;
    font-weight: bold;
    color: #333;
}

.selector-group {
    display: flex;
    align-items: center;
    margin-left: 10px;
    gap: 5px;
}

.selector-group select {
    padding: 1px;
    border: 1px solid #777;
    background-color: #fff;
    font-family: monospace;
    font-size: 1em;
}

.selector-group .selector-display {
    background-color: #d4edda;
    border: 1px solid #777;
    padding: 1px 5px;
    min-width: 80px;
    text-align: center;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 17% 37% 45%;
    grid-template-rows: auto 1fr;
    gap: 5px;
    padding: 5px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.panel {
    background-color: #d4edda;
    border: 1px solid #777;
    padding: 5px;
}

.panel-left {
    grid-column: 1;
    grid-row: 1;
}

.panel-middle{
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
}

.panel-right {
    grid-column: 3;
    grid-row: 1;
}

.panel-bottom {
    grid-column: 1 / span 3;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.panel-left .stat-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    font-weight: bold;
}

.panel-left .stat-row-top input {
    width: 50px;
    padding: 1px;
    border: 1px solid #777;
    background-color: #fff;
    font-family: monospace;
}

.panel-left .stat-row-top .stat-display {
    background-color: #fff;
    border: 1px solid #777;
    padding: 1px 5px;
    min-width: 60px;
    text-align: right;
    font-size: 0.9em;
}

#points-unallocated {
    visibility: hidden;
}

.panel-left h3 {
    font-size: 1em;
    margin: 10px 0 5px 0;
    text-align: center;
    border-bottom: 1px dashed #777;
    padding-bottom: 3px;
}

.stat-input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    font-weight: bold;
    gap: 5px;
}

.stat-cost {
    color: #666;
    font-size: 0.9em;
    min-width: 20px;
    text-align: right;
}

.stat-input-row input {
    width: 50px;
    padding: 1px;
    border: 1px solid #777;
    background-color: #fff;
    font-family: monospace;
}

.stat-buff-bonus {
    color: #0a8400;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 30px;
    text-align: left;
}

.derived-stats-section {
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.derived-row-column span:nth-child(odd) {
    display: inline-block;
    min-width: 60px;
    max-width: 60px;
    min-height: 17px;
    max-height: 17px;
    margin-top: 2px;
    text-align: left;
    font-weight: bold;
}

.derived-row-column span:nth-child(even) {
    display: inline-block;
    min-width: 50px;
    max-width: 50px;
    min-height: 13px;
    max-height: 13px;
    padding-left: 5px;
    margin-top: 2px;
    background-color: #fff;
    box-sizing: border-box;
}

.derived-row-column {
    display: flex;
    flex-direction: row;
    min-width: 110px;
    max-width: 110px;
    height: 17px;
    margin-left: 5px;
}

.spacer-item,
.derived-row-column-spacer {
    min-width: 110px;
    max-width: 110px;
    height: 17px;
    margin-left: 5px;
    background-color: rgba(0, 0, 0, 0);
}

.horsemanship-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 5px;
    margin-top: 5px;
}
.horsemanship-row span {
    font-weight: bold;
}
.horsemanship-row span.re-horse {
    background-color: #fff;
    border: 1px solid #777;
    padding: 1px 5px;
}
.horsemanship-row span#total-re-horse {
    background-color: #fff;
    border: 1px solid #777;
    padding: 1px 5px;
    min-width: 30px;
    text-align: right;
}

#skills-panel {
    padding: 5px;
    background-color: #d4edda;
}

#skills-panel h2 {
    font-size: 1em;
    margin: 0 0 5px 0;
    text-align: center;
    border-bottom: 1px dashed #777;
    padding-bottom: 3px;
}

.skill-category {
    background-color: #aed6a1;
    padding: 2px 5px;
    margin-bottom: 2px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    border-radius: 2px;
    font-size: 0.9em;
}

.skill-name {
    flex-basis: 45px;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-bar-container {
    flex-grow: 1;
    height: 8px;
    background-color: #ccc;
    position: relative;
    margin: 0 3px;
    border-radius: 1px;
    overflow: hidden;
    border: 1px solid #888;
}

.skill-adeptness-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #33b5e5;
    width: 0%;
    z-index: 1;
}

.skill-potential-line {
    position: absolute;
    top: 0;
    height: 100%;
    background-color: #007bff;
    width: 1px;
    left: 0%;
    z-index: 2;
}

.skill-level-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    z-index: 1;
    border-radius: 1px;
}

.skill-level-line.empty {
    background-color: transparent;
}

.skill-level-line.filled-gradient {
    background: linear-gradient(to right, #4CAF50, #8BC34A);
}

.skill-level-line.max-gradient {
    background: linear-gradient(to right, #000000, #007bff);
}

.skill-level-display {
    width: 35px;
    text-align: right;
    font-family: monospace;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 2px;
}

.skill-controls,
.skill-cost {
    display: none;
}

.panel-bottom h2,
.panel-bottom h3 {
    font-size: 1em;
    margin: 5px 0;
    text-align: center;
    border-bottom: 1px dashed #777;
    padding-bottom: 2px;
    width: 90%;
}

.equipment-selectors-grid {
    display: grid;
    grid-template-columns: repeat(
        3,
        1fr
    );
    gap: 5px 10px;
    width: 100%;
}

.equipment-selectors-grid .input-group {
    margin-bottom: 0;
}

.equipment-selectors-grid label {
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 2px;
}

.equipment-selectors-grid select {
    width: 100%;
    padding: 1px;
    border: 1px solid #777;
    background-color: #fff;
    font-family: monospace;
    font-size: 0.9em;
}

#set-bonus-display {
    width: 90%;
    background-color: #e0f2d4;
    border: 1px solid #777;
    padding: 5px;
    margin-top: 5px;
}

#set-bonus-list {
    list-style-type: none;
    padding-left: 0;
    font-size: 0.85em;
    color: #0056b3;
    margin: 0;
}

.stat-value.overspent {
    color: #e63946;
}

select {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%2C197.3L146.2%2C56.6L5.4%2C197.3H287z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 5px top 50%;
    background-size: 8px auto;
}

.sim-row {
    height: 1.5em;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 4px;
    box-sizing: border-box;
}

.panel-left .stat-row-top,
.stat-input-row,
.derived-row {
    display: flex;
    align-items: center;
    margin: 0.5em;
    padding: 0 4px;
    box-sizing: border-box;
}

.skill-row {
    display: flex;
    align-items: center;
    padding: 1px 2px;
    height: 1.9em;
    box-sizing: border-box;
    margin-bottom: 1px;
    background-color: #e0f2d4;
    border: 1px solid #bbd0ae;
    border-radius: 2px;
    gap: 4px;
}

.skill-name {
    flex: 0 0 40px;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-level-line-container {
    flex: 1;
    height: 8px;
    background-color: #ccc;
    position: relative;
    border-radius: 1px;
    overflow: hidden;
    border: 1px solid #888;
    margin: 0 4px;
}

.skill-numerical-display {
    flex: 0 0 50px;
    text-align: center;
    font-family: monospace;
    font-size: 1em;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-add-sub-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1px;
    font-size: 0.8em;
    flex-wrap: wrap;
}

.skill-btn {
    width: 18px;
    height: 18px;
    border: 1px solid #666;
    background-color: #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.skill-btn.skill-btn-wide {
    width: 22px;
    font-size: 10px;
}

.skill-btn[data-amount="min"] {
    background-color: #ffe6e6;
    color: #cc0000;
}

.skill-btn[data-amount="max"] {
    background-color: #e6f3ff;
    color: #0066cc;
}

.skill-btn:hover {
    background-color: #e0e0e0;
}

.cost-display {
    font-size: 0.75em;
    color: #666;
    white-space: nowrap;
}

.panel-left .stat-row-top,
.stat-input-row,
.derived-row,
.skill-row {
    padding-top: 0;
    padding-bottom: 0;
}

.stat-input-row {
    margin-bottom: 0;
}

.panel-left .stat-row-top {
    margin-bottom: 0;
}

.derived-row {
    margin-bottom: 0;
    background-color: #e0f2d4;
    border: 1px solid #bbd0ae;
    height: 2em;
}

.panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.reset-buttons-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.reset-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.reset-btn:hover {
    background-color: #e0e0e0;
}

.reset-btn:active {
    background-color: #d0d0d0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #c0d9a9;
    margin: 5% auto;
    padding: 0;
    border: 2px solid #555;
    border-radius: 5px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-family: monospace;
}

.modal-header {
    padding: 10px 15px;
    background-color: #aed6a1;
    border-bottom: 1px solid #777;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: #000;
}

.close {
    color: #000;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px;
}

.close:hover,
.close:focus {
    color: #666;
}

.modal-body {
    padding: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.unlocked-skill-category {
    margin-bottom: 20px;
}

.unlocked-skill-category h3 {
    margin: 0 0 10px 0;
    padding: 5px 10px;
    background-color: #aed6a1;
    border: 1px solid #777;
    border-radius: 3px;
    font-size: 1.1em;
}

.unlocked-skill-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    margin-bottom: 5px;
    background-color: #e8f4e1;
    border: 1px solid #b5d6a9;
    border-radius: 3px;
    gap: 4px;
}

.unlocked-skill-item.locked {
    background-color: #f0f0f0;
    color: #666;
    border-color: #ccc;
}

.skill-name-unlock {
    font-weight: bold;
    min-width: 150px;
}

.skill-description-unlock {
    flex: 1;
    margin: 0 10px;
    font-size: 0.9em;
}

.skill-requirement {
    font-size: 0.85em;
    color: #555;
    min-width: 100px;
    text-align: right;
}

.skill-requirement.met {
    color: #2d5a2d;
    font-weight: bold;
}

.skill-requirement.not-met {
    color: #a52a2a;
}

.skill-modal-stats-base {
    font-size: 0.8rem;
    color: #666;
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 2px;
    border: 1px solid #ddd;
    font-family: monospace;
    align-self: flex-start;
    margin: 1px 0;
}

.skill-modal-stats {
    font-size: 0.8rem;
    color: #0066cc;
    background-color: #f0f8ff;
    padding: 2px 5px;
    border-radius: 2px;
    border: 1px solid #b3d9ff;
    font-family: monospace;
    align-self: flex-start;
    margin: 1px 0;
}

.modal-content-wide {
    width: 90%;
    max-width: 1000px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.equipment-slot {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.equipment-slot label {
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.equipment-slot select {
    padding: 5px;
    border: 1px solid #777;
    border-radius: 3px;
    background-color: #fff;
    font-family: monospace;
    font-size: 0.9em;
}

.buff-section {
    margin-bottom: 20px;
}

.buff-section h3 {
    margin: 0 0 10px 0;
    padding: 5px 10px;
    background-color: #aed6a1;
    border: 1px solid #777;
    border-radius: 3px;
    font-size: 1em;
}

.buff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.buff-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background-color: #e8f4e1;
    border: 1px solid #b5d6a9;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.buff-item:hover {
    background-color: #d8e8d1;
}

.buff-item input[type="checkbox"] {
    margin: 0;
}

.buff-item-container {
    margin-bottom: 15px;
}

.enchanter-spi-controls {
    margin-left: 20px;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

.enchanter-spi-controls label {
    margin-right: 8px;
    font-weight: normal;
}

.enchanter-spi-controls select {
    padding: 2px 5px;
    font-size: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
}

.buff-item span {
    font-size: 0.9em;
    color: #333;
}

.no-skills-message {
    padding: 20px;
    text-align: center;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 10px 0;
}

.no-skills-message p {
    margin: 10px 0;
}

.job-info {
    padding: 10px;
    background-color: #e8f4e1;
    border: 1px solid #b5d6a9;
    border-radius: 3px;
    margin-bottom: 15px;
}

.job-info p {
    margin: 0;
    font-weight: bold;
}

.skill-tree-group {
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid #b5d6a9;
}

.skill-tree-group h4 {
    margin: 0 0 8px 0;
    padding: 3px 8px;
    background-color: #d4e8ca;
    border: 1px solid #b5d6a9;
    border-radius: 3px;
    font-size: 1em;
    color: #2d5a2d;
}

/* Proficiency Progress Bars */
.proficiency-progress {
    margin: 8px 0;
    padding: 4px 0;
}

.proficiency-progress-text {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 4px;
    font-weight: 500;
}

.proficiency-progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ccc;
}

.proficiency-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 5px;
}

.proficiency-progress-fill.incomplete {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.proficiency-progress-fill.completed {
    background: linear-gradient(90deg, #4caf50, #81c784);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* Enhance unlocked skill items with proficiency info */
.unlocked-skill-item.unlocked .proficiency-progress-text {
    color: #2d5a2d;
    font-weight: 600;
}

.unlocked-skill-item.locked .proficiency-progress-text {
    color: #8d6e63;
}
