*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:14px;background:#1e293b;color:#e2e8f0;min-height:100vh}#root{min-height:100vh;display:flex;flex-direction:column}button,button *{user-select:none;-webkit-user-select:none;-moz-user-select:none}button{font:inherit;cursor:pointer;padding:.35rem .75rem;border-radius:4px;border:1px solid #475569;background:#334155;color:#e2e8f0}button:hover{background:#475569}button:disabled{opacity:.6;cursor:not-allowed}input,textarea{font:inherit;padding:.35rem .5rem;border-radius:4px;border:1px solid #475569;background:#0f172a;color:#e2e8f0}input::placeholder,textarea::placeholder{color:#64748b}.app{display:flex;flex-direction:column;flex:1;max-width:1400px;margin:0 auto;width:100%;padding:1rem;gap:1rem;overflow:hidden}.app-header{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;padding:.75rem;background:#0f172a;border-radius:8px;border:1px solid #334155}.app-header label{display:flex;align-items:center;gap:.5rem}.app-header input[type=text]{width:120px}.tab-bar{display:flex;align-items:flex-start;justify-content:flex-end;gap:.5rem;padding:.35rem .5rem;min-height:40px;background:#6b7b8d}.tab-bar-actions{display:flex;align-items:center;gap:.25rem;flex-shrink:0}.tab-bar-tabs{display:grid;grid-template-columns:repeat(4,1fr);align-items:center;gap:.25rem}.tab{padding:.4rem .75rem;border-radius:4px;border:1px solid #a0aab4;background:#c8d0d8;color:#1a1a2e;cursor:pointer;font-weight:500}.tab:hover{background:#dde3e8}.tab.selected{background:#90caf9;border-color:#42a5f5;color:#0d1b2a}.tab.dragging{opacity:.6}.tab-bar-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;color:#c8d0d8;border-color:#8a949e;background:transparent}.tab-bar-btn:hover{color:#fff;background:#8a949e}.tab-bar-btn:first-of-type{margin-left:0}.main-content{display:flex;gap:1rem;flex:1;min-height:0}.tab-editor{flex:0 0 200px;display:flex;flex-direction:column;gap:.75rem;padding:1rem;background:#0f172a;border-radius:8px;border:1px solid #334155}.tab-editor h3{margin:0 0 .25rem;font-size:.9rem;color:#94a3b8}.main-sidebar{flex:0 0 260px;display:flex;flex-direction:column;gap:.5rem;min-height:0}.key-editor-wrap{flex:1;min-height:0;overflow:auto}.undo-redo-bar{display:flex;justify-content:flex-end;gap:.25rem}.undo-redo-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;color:#94a3b8}.undo-redo-btn:hover:not(:disabled){color:#e2e8f0}.undo-redo-btn:disabled{opacity:.4}.grid-area{display:flex;flex-direction:column;flex:1;min-width:0;padding:0;background:#6b7b8d;border-radius:8px;border:1px solid #334155;overflow:hidden}.grid-area .tab-bar{margin-top:0}.key-grid-container{display:flex;flex-direction:column;min-width:0;flex:1}.key-grid-scroll-wrap{overflow-x:auto;overflow-y:hidden;min-width:0}.key-grid-inner{width:max-content;min-width:100%}.key-grid{display:grid;gap:4px;padding:8px;background:#b0bec5;height:480px;overflow:hidden;box-sizing:border-box}.key-cell,.key-cell *{user-select:none;-webkit-user-select:none;-moz-user-select:none}.key-cell{min-height:0;padding:.25rem .4rem;border-radius:4px;border:1px solid #8a9aa8;background:#c8cfd6;color:#1a1a2e;cursor:pointer;font-size:.8rem;font-weight:500;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;line-height:1.25;box-shadow:1px 1px 3px #00000040;overflow:hidden}.key-cell:hover{border-color:#64748b;background:#d8dfe6}.key-cell.selected{border-color:#42a5f5;background:#90caf9}.key-cell.dragging{opacity:.7}.key-cell.over{border-color:#22c55e;background:#c8e6c9}.key-cell-empty{color:#8a9aa8;font-style:italic;background:#b0bcc6;border-color:#7a8a98;box-shadow:inset 1px 1px 2px #00000026}.key-cell-no-station{color:#78909c}.key-grid-bottom-row{display:flex;align-items:flex-start;justify-content:space-between;gap:.5rem;margin-top:.5rem}.key-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem}.key-action-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;color:#94a3b8}.key-action-btn:hover:not(:disabled){color:#e2e8f0}.move-pad{display:grid;grid-template-columns:1fr 1fr 1fr;grid-template-rows:1fr 1fr 1fr;grid-template-areas:". up ." "left . right" ". down .";width:72px;height:72px;padding:6px;border-radius:50%;border:1px solid #475569;background:#334155;align-items:center;justify-items:center;flex-shrink:0}.move-pad-btn{width:20px;height:20px;min-width:20px;min-height:20px}.move-pad-btn:nth-child(1){grid-area:up}.move-pad-btn:nth-child(2){grid-area:down}.move-pad-btn:nth-child(3){grid-area:left}.move-pad-btn:nth-child(4){grid-area:right}.key-editor-btn{display:inline-flex;align-items:center;gap:.35rem;color:#94a3b8}.key-editor-btn:hover{color:#e2e8f0}.key-editor-btn svg{flex-shrink:0}.key-editor{flex:0 0 260px;display:flex;flex-direction:column;gap:.75rem;padding:1rem;background:#0f172a;border-radius:8px;border:1px solid #334155}.key-editor-placeholder{color:#64748b;font-style:italic}.key-editor input[type=text],.key-editor textarea{width:100%}.key-editor textarea{min-height:60px;resize:vertical}.breadcrumb{font-size:.85rem;color:#94a3b8;margin-bottom:.5rem}.breadcrumb-segment{display:inline}.breadcrumb-sep{color:#64748b;pointer-events:none}.breadcrumb button{background:none;border:none;color:#3b82f6;padding:.2rem 0;text-decoration:underline;font:inherit;cursor:pointer}.breadcrumb button:hover{color:#60a5fa}.breadcrumb-current{color:#e2e8f0;font-weight:500}.key-editor-subpage-actions{display:flex;flex-wrap:wrap;gap:.5rem}.key-cell{position:relative}.key-cell-corner-indicators{position:absolute;bottom:.25rem;right:.35rem;display:inline-flex;align-items:center;gap:.25rem}.key-cell-meta-indicator{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:999px;background:#fff3e0;border:1px solid #e0a040;color:#e65100;font-size:.55rem;font-weight:600;line-height:1}.key-cell-meta-indicator svg{width:10px;height:10px;display:block}.key-cell-subpage-indicator{display:flex;align-items:center;justify-content:center;color:#546e7a;opacity:.9}.key-cell-mismatch-indicator{position:absolute;top:.25rem;right:.35rem;display:flex;align-items:center;justify-content:center;color:#e65100;opacity:.95;pointer-events:none}.client-page-badge{display:inline-block;padding:.2rem .5rem;font-size:.75rem;background:#475569;border-radius:4px;color:#94a3b8;margin-left:.5rem}.load-error{padding:1rem;background:#7f1d1d;border:1px solid #991b1b;border-radius:8px;color:#fecaca;margin-bottom:1rem}.key-cell-line{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.key-cell-line+.key-cell-line{margin-top:.15em}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal{background:#0f172a;border:1px solid #334155;border-radius:8px;padding:1.5rem;max-width:360px}.modal h2{margin:0 0 .5rem;font-size:1.1rem}.modal p{margin:0 0 1rem;color:#94a3b8;font-size:.95rem}.modal label{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1rem}.modal label input{width:100%}.modal-actions{display:flex;flex-wrap:wrap;gap:.5rem}.station-id-field{display:flex;flex-direction:column;gap:.35rem}.station-id-label{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}.station-id-load-btn{font-size:.85rem;padding:.25rem .5rem}.station-id-load-error{margin:0;font-size:.85rem;color:#fca5a5}.station-id-input-wrap{position:relative}.station-id-suggestions{position:absolute;left:0;right:0;top:100%;margin:0;padding:.25rem 0;list-style:none;max-height:220px;overflow-y:auto;background:#0f172a;border:1px solid #475569;border-radius:4px;box-shadow:0 4px 12px #0000004d;z-index:10}.station-id-suggestion{display:flex;align-items:baseline;gap:.35rem;padding:.35rem .5rem;cursor:pointer;font-size:.9rem}.station-id-suggestion:hover,.station-id-suggestion.highlighted{background:#334155;color:#e2e8f0}.station-id-suggestion-id{font-weight:500}.station-id-suggestion-fir{color:#94a3b8;font-size:.85rem}.station-id-unknown{margin:0;font-size:.85rem;color:#fbbf24}
