/* Centro de herramientas: formularios, consultas y archivo de la partida. */
.game-tool-dialog{width:min(920px,calc(100vw - 40px));max-width:calc(100vw - 40px);max-height:min(90dvh,1000px);margin:auto;padding:0;border:1px solid #d8e1ec;border-radius:16px;background:#f7f9fc;color:#162438;box-shadow:0 24px 80px #0c193d55;overflow:auto;font-family:inherit}
.game-tool-dialog.electoral-map-dialog{width:min(1160px,calc(100vw - 30px));max-width:calc(100vw - 30px)}
.game-tool-dialog *{box-sizing:border-box}.game-tool-dialog::backdrop{background:#101d31b8;backdrop-filter:blur(3px)}
.game-tool-dialog>.tool-header{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 26px;border-bottom:1px solid #e1e7ee;background:#fff}
.game-tool-dialog .tool-header h2{margin:3px 0 0;color:#162438;font-size:clamp(19px,2.5vw,25px);letter-spacing:-.025em;line-height:1.2}
.game-tool-dialog .tool-header button{display:inline-flex;align-items:center;gap:8px;flex:none;min-height:40px;padding:9px 12px;border:1px solid #dbe3ed;border-radius:8px;background:#fff;color:#526781;font-size:12px;font-weight:700}
.game-tool-dialog .tool-header button:hover{background:#eff3fb;color:#345de1}.game-tool-dialog .tool-header button span{font-size:20px;line-height:12px}
.game-tool-dialog .tool-body{padding:22px 26px 30px;min-width:0}.game-tool-dialog .tool-body>p:first-child{margin-top:0}
.game-tool-dialog p{color:#63748a;font-size:13px;line-height:1.6}.game-tool-dialog h3{margin:0;color:#162438;font-size:17px;letter-spacing:-.02em}.game-tool-dialog small{color:#71839a;font-size:11px;line-height:1.5}
.game-tool-dialog .tool-eyebrow{display:block;color:#7e8ea3;font-size:10px;font-weight:800;letter-spacing:.13em;line-height:1.3;text-transform:uppercase}
.game-tool-dialog .tool-intro{margin:0 0 20px;padding:18px 20px;border:1px solid #dbe4f6;border-left:4px solid #345de1;border-radius:9px;background:#edf2ff}.game-tool-dialog .tool-intro p{max-width:680px;margin:7px 0 0;color:#4e6482}
.game-tool-dialog .tool-section-head{display:flex;align-items:end;justify-content:space-between;gap:12px;margin:24px 0 12px}.game-tool-dialog .tool-section-head h3{margin-top:5px}.game-tool-dialog .tool-section-head>span{color:#8493a5;font-size:11px;text-align:right}
.game-tool-dialog label{display:block;min-width:0;margin:12px 0;color:#40536c;font-size:12px;font-weight:700;line-height:1.4}
.game-tool-dialog input:not([type=checkbox]):not([type=radio]),.game-tool-dialog select,.game-tool-dialog textarea{display:block;width:100%;max-width:100%;min-width:0;min-height:42px;margin:6px 0 0;padding:9px 11px;border:1px solid #ccd7e3;border-radius:8px;background:#fff;color:#162438;font:inherit;font-weight:500}
.game-tool-dialog input[type=color]{max-width:80px!important;padding:4px!important;cursor:pointer}.game-tool-dialog input[type=checkbox],.game-tool-dialog input[type=radio]{width:17px;height:17px;flex:0 0 17px;margin:0;accent-color:#345de1}
.game-tool-dialog input:focus,.game-tool-dialog select:focus,.game-tool-dialog textarea:focus{outline:3px solid #dce5ff;border-color:#7893f0}
.game-tool-dialog fieldset,.game-tool-dialog details{min-width:0;margin:14px 0;padding:16px;border:1px solid #dfe6ef;border-radius:10px;background:#fff}.game-tool-dialog fieldset legend{padding:0 6px;color:#253b58;font-size:13px;font-weight:800}.game-tool-dialog details>summary{color:#294160;font-size:13px;font-weight:800;cursor:pointer}.game-tool-dialog details[open]>summary{margin-bottom:12px}
.game-tool-dialog button.secondary-button,.game-tool-dialog button.campaign-primary,.game-tool-dialog .internal-status-buttons button{min-height:42px;padding:10px 14px;border:1px solid #d2ddec;border-radius:8px;background:#fff;color:#365173;font:inherit;font-size:12px;font-weight:800;cursor:pointer}.game-tool-dialog button.secondary-button:hover,.game-tool-dialog .internal-status-buttons button:hover:not(:disabled){border-color:#345de1;color:#345de1;background:#f0f4ff}.game-tool-dialog button.campaign-primary{border-color:#345de1;background:#345de1;color:white}.game-tool-dialog button.campaign-primary:hover{background:#2849ba}.game-tool-dialog button:disabled{opacity:.5;cursor:not-allowed}.game-tool-dialog button:focus-visible{outline:3px solid #abc0ff;outline-offset:2px}
.game-tool-dialog [data-error]:not(:empty){padding:12px 14px;border:1px solid #f0c8c5;border-radius:8px;background:#fff0ef;color:#a33435;font-weight:700}.game-tool-dialog [data-error]:empty{display:none}.game-tool-dialog [hidden]{display:none!important}
.tool-control-grid,.tool-fields-grid,.tool-effects-grid,.tool-transfer-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}.tool-control-grid>label,.tool-fields-grid>label,.tool-transfer-controls>label{margin:0}.tool-control-grid{padding:16px;border:1px solid #dfe6ee;border-radius:10px;background:#fff}.tool-effects-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.game-tool-dialog .tool-effects-grid fieldset{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:10px;margin:0}.tool-effects-grid label{margin:0}.tool-transfer-controls{grid-template-columns:1fr 1fr 140px}.tool-action-bar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:24px;padding:15px 0 0;border-top:1px solid #dce4ed}.tool-action-bar p{margin:0;font-size:12px}.tool-action-bar button{flex:none}.tool-check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}.game-tool-dialog .tool-check-grid label,.game-tool-dialog .regional-party-option,.game-tool-dialog .transfer-area-scope label{display:flex;align-items:center;gap:9px;margin:0;padding:10px;border-radius:7px;background:#f4f7fb;font-size:12px;font-weight:600}.tool-party-editor [data-identity]{margin-top:20px}.tool-party-editor .regional-party-option{margin:16px 0 7px!important}.tool-party-editor [data-identity]>small{display:block;margin:0 0 14px}.tool-party-editor [data-identity]>label:not(.regional-party-option){max-width:420px}.tool-simulation [data-transfer-preview]{margin-top:18px}.tool-simulation [data-transfer-row]>button{margin-top:10px}.tool-simulation .transfer-area-scope{background:#f7f9fc}.tool-simulation .transfer-area-scope label{margin:5px 0}
.game-tool-dialog .poll-table-wrap{width:100%;max-width:100%;overflow:auto;border:1px solid #e0e7ef;border-radius:10px;background:#fff}.game-tool-dialog .poll-table{width:100%;min-width:480px;border-collapse:collapse;text-align:left;font-size:12px}.game-tool-dialog .poll-table th{padding:12px 10px;background:#f4f7fb;color:#8492a4;font-size:10px;letter-spacing:.05em;text-transform:uppercase}.game-tool-dialog .poll-table td{padding:11px 10px;border-top:1px solid #ecf0f4;color:#30435d}.game-tool-dialog .poll-table td:not(:first-child),.game-tool-dialog .poll-table th:not(:first-child){text-align:right;white-space:nowrap}.tool-party,.game-tool-dialog .party-name-with-logo{display:inline-flex;align-items:center;gap:8px}.tool-party strong{font-size:12px}.tool-vote{display:inline-flex;align-items:end;flex-direction:column;gap:5px;font-weight:800}.tool-vote i{display:block;width:65px;height:4px;border-radius:5px;background:linear-gradient(to right,var(--party) var(--vote),#e9eef4 var(--vote))}.tool-caption{font-size:11px!important}.seat-margin-area .poll-table{min-width:540px}
.history-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:16px;border:1px solid #dfe6ee;border-radius:10px;background:white}.history-filters label{margin:0}.history-chart-card{margin:15px 0;padding:18px;border:1px solid #dfe6ef;border-radius:10px;background:white}.history-chart{display:block;width:100%;height:auto;color:#73839a}.history-legend{display:flex;flex-wrap:wrap;gap:9px 15px;margin-top:16px;color:#51647f;font-size:11px}.history-legend span{display:inline-flex;align-items:center;gap:5px}.history-legend i{width:9px;height:9px;border-radius:50%}.history-table{max-height:340px;overflow:auto}.history-table+.game-tool-dialog h3{margin-top:20px}
.tool-party-filter{max-width:370px}.tool-cohesion{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center;padding:18px;border:1px solid #dbe4f6;border-radius:10px;background:#edf2ff}.tool-cohesion h3{margin:6px 0}.tool-cohesion h3 strong{color:#345de1}.tool-cohesion p{margin:6px 0 0}.internal-faction{margin:12px 0;padding:18px;border:1px solid #dfe6ef;border-radius:10px;background:#fff}.internal-faction h3{margin:0 0 7px}.internal-faction>strong{font-size:13px;color:#345de1}.internal-faction p{margin:9px 0}.internal-status-buttons{display:flex;flex-wrap:wrap;gap:8px}.game-tool-dialog .internal-status-buttons .selected{border-color:#345de1;background:#345de1;color:white}.internal-faction details{background:#f7f9fc}.internal-faction form{display:grid;grid-template-columns:1fr 1fr;gap:10px}.internal-faction form button{align-self:end}
.party-logo-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;margin:20px 0}.party-logo-card{display:flex;flex-direction:column;align-items:center;min-width:0;padding:20px 12px;border:1px solid #dfe6ef;border-radius:10px;background:white;text-align:center}.party-logo-card>.party-logo{width:90px;height:90px;border:0}.party-logo-card h3{margin:12px 0 3px;font-size:14px;overflow-wrap:anywhere}.party-logo-card>span:not(.party-logo){color:#7b8ba0;font-size:11px}.party-logo-card a{display:inline-block;margin-top:12px;color:#345de1;font-size:12px;font-weight:800}.party-logo-card small{margin-top:12px}
@media(max-width:700px){.game-tool-dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:12px}.game-tool-dialog>.tool-header{padding:14px 16px}.game-tool-dialog .tool-body{padding:16px 16px 24px}.game-tool-dialog .tool-section-head{align-items:start;flex-direction:column}.game-tool-dialog .tool-section-head>span{text-align:left}.tool-control-grid,.tool-fields-grid,.tool-transfer-controls{grid-template-columns:1fr}.tool-effects-grid{grid-template-columns:1fr}.tool-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tool-action-bar{align-items:stretch;flex-direction:column}.tool-action-bar button{width:100%}.history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.history-chart-card{padding:12px 8px}.history-legend{gap:8px}.tool-cohesion{grid-template-columns:1fr;gap:8px}.internal-faction form{grid-template-columns:1fr}.party-logo-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.game-tool-dialog .vote-check-table{display:block;min-width:0}.vote-check-table thead{display:none}.vote-check-table tbody{display:block}.vote-check-table tr{display:grid;grid-template-columns:minmax(0,1fr) 75px 65px;gap:5px 8px;padding:12px;border-bottom:1px solid #e9eef4}.vote-check-table td{padding:0!important;border:0!important;text-align:right}.vote-check-table td:first-child{grid-column:1;grid-row:1/3;text-align:left;align-self:center}.vote-check-table td:nth-child(2){grid-column:2;grid-row:1}.vote-check-table td:nth-child(3){grid-column:2;grid-row:2;color:#7d8da2;font-size:10px}.vote-check-table td:nth-child(4){grid-column:3;grid-row:1}.vote-check-table td:nth-child(4):after{content:' esc.';font-size:10px;color:#8492a4}.vote-check-table td:nth-child(5){grid-column:3;grid-row:2;color:#7d8da2;font-size:10px}.tool-vote i{width:50px}.tool-party{gap:5px}.tool-party strong{overflow-wrap:anywhere}.history-filters{grid-template-columns:1fr 1fr}}
