.tower-control-body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    font-family: Inter, system-ui, sans-serif;
    font-size: 11px;
    color: #e2e8f0;
}

.tower-control-body .tc-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
}

.tc-drivers {
    flex: 0 0 auto;
    max-height: 42vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(9, 13, 24, 0.92);
}

.tc-drivers.is-collapsed {
    max-height: none;
}

.tc-drivers.is-collapsed .tc-drivers-body {
    display: none;
}

.tc-drivers-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 58px;
    min-height: 32px;
    flex: 0 0 auto;
}

.tc-drivers-heading {
    flex: 1;
    min-width: 0;
    padding-left: 6px;
    border-left: 2px solid #22c55e;
}

.tc-drivers-header h1 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
}

.tc-drivers-hint {
    margin: 2px 0 0;
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
}

.tc-drivers-body {
    padding: 0 8px 8px;
    overflow: auto;
    min-height: 0;
}

.tc-add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.tc-add-form input {
    flex: 1 1 120px;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    font-size: 11px;
}

.tc-table-wrap {
    overflow: auto;
    max-height: 22vh;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 4px;
}

.tc-table-wrap.is-empty .tc-table {
    display: none;
}

.tc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.tc-table th,
.tc-table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.tc-table th {
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.98);
    font-weight: 700;
    color: #94a3b8;
}

.tc-table tr:last-child td {
    border-bottom: none;
}

.tc-table .tc-actions {
    white-space: nowrap;
    text-align: right;
}

.tc-empty {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
}

.tc-embeds {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.tc-embed-tabbar {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 4px 8px 0 58px;
    flex: 0 0 auto;
    overflow-x: auto;
    background: rgba(9, 13, 24, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.tc-embed-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 180px;
    padding: 4px 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
}

.tc-embed-tab.is-active {
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    border-color: rgba(34, 197, 94, 0.45);
}

.tc-embed-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-embed-tab-close {
    padding: 0 4px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.tc-embed-tab-close:hover {
    color: #f87171;
}

.tc-embed-tab-add {
    flex: 0 0 auto;
    padding: 4px 10px;
    margin-bottom: 1px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.tc-embed-tab-add:hover {
    color: #e2e8f0;
    border-color: rgba(34, 197, 94, 0.5);
}

.tc-embed-toolbar {
    padding-left: 58px;
}

.tower-control-body .sp-chrome-title {
    border-left-color: #22c55e;
}

.tc-embed-panes {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.tc-embed-pane {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    min-height: 0;
}

.tc-embed-pane.is-active {
    display: flex;
}

.tc-embed-pane .sp-sheet-frame-wrap {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.tc-status {
    padding: 2px 8px 2px 58px;
    font-size: 10px;
    color: #94a3b8;
    flex: 0 0 auto;
}

.tc-status.is-error {
    color: #f87171;
}

.tc-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: auto;
}

.tc-modal[hidden] {
    display: none !important;
}

.tc-modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.55);
}

.tc-modal-card {
    position: relative;
    z-index: 1;
    width: min(400px, 96vw);
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.tc-modal-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    color: #e2e8f0;
}

.tc-modal-fields {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.tc-modal-field {
    display: grid;
    gap: 4px;
}

.tc-modal-field span {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}

.tc-modal-field input {
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(9, 13, 24, 0.95);
    color: #e2e8f0;
    font-size: 11px;
}

.tc-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
